JBuilder X+Jboss323+Struts1.1+Oracle 8i+J2EE 2.1+J




Oracle 8i, 还是等一阵子再升级到 9i吧。



回复此文章 | 我一头的雾水~

回复此文章 |

Question Multiple params with html:link tag?
How to code my Struts html:link tag such that I can apply multiple dynamic parameters?

For example, I want to achieve the following:

<a href="/DeptInfo/do/ViewDept?setID=<%=deptForm.getSetID()%>&<%=deptForm.getDeptID%>">

But I only know this much in terms of coding it with a Struts tags:

<html:link forward="ViewDept" paramName="deptForm" paramProperty="setID" paramId="setID" />

How do I get the deptID param into this tag as well? (And by the way, is my syntax above correct for the html:link tag??)


回复此文章 |
I sovled the problem.
I had spent a lot of time on sovling this problem.
I except you not to spend your time for this problem.

enjoy your life... :-)

One of Solutions |

<bean:parameter id="param1" name="param1" value="0"/>


java.util.HashMap params = new java.util.HashMap();
params.put("param1", param1);
pageContext.setAttribute("paramsName", params);

<html:link page="/show.do" name="paramsName" scope="page" >show.jsp</html:link>



回复此文章 |
Is there an elegant way of doing this without scriptlets?

Something like: -

<bean:define type="java.util.Map" id="tempParams>
<param id="type" value="cabbages"/>
<param id="sort" value="firmness"/>
<html:link page="/blah" paramName="tempParams">
Find the firmest cabbages



回复此文章 |

This is my code snipplet,
<bean:define id="param1" name="ele" property="score"/>
<bean:define id="param2" name="ele" property="color" />
java.util.HashMap params = new java.util.HashMap();
params.put("regno", param1);
params.put("regname", param2);
pageContext.setAttribute("paramsName", params);

<html:link styleClass="link" page="/xAction.do?
action=x" name="paramsName"/>

I dont want to use the scriptlet. I want to put these two beans(param1 and param2) in another bean collection using struts tags, so that I could use the created bean name in my link. Could anyone pls help me in providing a solution for this.


回复此文章 |

I had solved my problem.I want to set two request parameters value by objects had stored in session,but is there has better solution?thanks a lot

1.use <bean:define> get values from object stored in session.
2.declare HashMap instance params to store request params
3.add to <html:link> with 'name' attribute.
as follow:
<bean:define id="category" name="product" property="categoryId"/>
<bean:define id="keywords" name="item" property="attribute4"/>
java.util.HashMap params = new java.util.HashMap();
pageContext.setAttribute("paramsName", params);

<html:link name="paramsName" scope="page" page="/searchItems.do">
<bean:write name="item" property="attribute4" />

hofman   2005-11-19 22:40:38 评论:0   阅读:1430   引用:0





内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog