如何在struts 1.2中使用html:link传递html:text值
我的 jsp 页面使用逻辑迭代显示一个列表。显示的每一行也有一个编辑链接。编辑链接时,单击的名称将更改为文本框,以便可以编辑。并与提交链接一起发送。 html:text 值我需要用 html:link 发送。 我的 jsp 部分如下,其中
html:text property="newId" value="<%=modId%>"/>我想将此属性作为带有 html 链接的哈希图传递,因为我发送“/> 作为 param1 请帮忙。或建议任何其他方法来执行此操作。谢谢。
####################################################################################
<logic:equal name="mode" value ="1">
<td><bean:write name="display" property="productId"/></td>
<logic:notEqual name="edit" value="1">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<td><html:text property="newId" value="<%=modId%>"/></td>
</logic:equal>
<logic:notEqual name="display" property="productName" value ="<%=modId%>">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
</logic:equal>
<bean:define id="param1" name="display" property="productName"/>
<%
String changedName=request.getParameter("changedName");
System.out.println(" st: " + changedName);
java.util.HashMap params = new java.util.HashMap();
if(param1!=null)
params.put("objectToEdit", param1);
params.put("abc",param1);
pageContext.setAttribute("paramsName", params);
%>
</logic:equal>
#####################################################################################
Same JSP HTML:LINK PArt
#######################################
<html:link action="Manager?edit=1" name="paramsName" onclick="return modify()">
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<img src="../images/commit.png" border="0" style="background-color:blue" title=" bean:message key="commit.data"/>" >
</logic:equal>
</logic:equal>
</html:link>
My jsp page display a list using logic iterate. every row displayed has a edit link too. when edit linked clicked Name will be changed to textbox so it can be edited.and sent along with commit link. html:text value i need to send with html:link.
part of my jsp is below,where I have
html:text property="newId" value="<%=modId%>"/> I want to pass this property as hashmap with html link as I am sending "/> as param1 Please help. or suggest any other way to do this. Thanks .
####################################################################################
<logic:equal name="mode" value ="1">
<td><bean:write name="display" property="productId"/></td>
<logic:notEqual name="edit" value="1">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<td><html:text property="newId" value="<%=modId%>"/></td>
</logic:equal>
<logic:notEqual name="display" property="productName" value ="<%=modId%>">
<td><bean:write name="display" property="productName" /></td>
</logic:notEqual>
</logic:equal>
<bean:define id="param1" name="display" property="productName"/>
<%
String changedName=request.getParameter("changedName");
System.out.println(" st: " + changedName);
java.util.HashMap params = new java.util.HashMap();
if(param1!=null)
params.put("objectToEdit", param1);
params.put("abc",param1);
pageContext.setAttribute("paramsName", params);
%>
</logic:equal>
#####################################################################################
Same JSP HTML:LINK PArt
#######################################
<html:link action="Manager?edit=1" name="paramsName" onclick="return modify()">
<logic:equal name="edit" value ="1">
<logic:equal name="display" property="productName" value ="<%=modId%>">
<img src="../images/commit.png" border="0" style="background-color:blue" title=" bean:message key="commit.data"/>" >
</logic:equal>
</logic:equal>
</html:link>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我使用 java 脚本完成了它。
希望我的解决方案可以帮助某人
Well I did it using java script.
hope my solution help someone