开发者

Struts 1.x tags usage question

I have a jsp page with the tags:

 <logic:iterate id="var" ...
    ....
    <bean:write name="var" property="p1" ...

    etc.

And I need, on each iteration, to generate a href composed from the various bean's properties. I even need to URLEncode some of them so the link works.

Something like

 <logic:iterate i开发者_JAVA技巧d="var" ...
    ....
    <html:link action="otheraction.do?_X_

    <bean:write name="var" property="p1" ...

    etc

where X is generated by collecting the bean's properties; something like

 String X="p1="+URLEncode(p1)+"&p2="+SimpleDateFormatof(p2)+"&p3="+p3;

How can I do that ?

Thanks in advance.


Better to make one POJO class.
1. Assign all your values to the object in Action which is being called before your jsp page comes in the picture.
2. Keep the object of POJO to request attribute.
3. Get the value from request attribtue on JSP using <bean:write> tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜