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 id="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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top