Vinod Kumar wrote:
Hi All,
I am trying to create a list of html links
dynamiclly. I have a collection of links. My HyperLink
class has one linkURL field and another linkDesc field
(its a javabean).
When I iterate thru these links, the double quotes are
causing problem and i have tried every possible
combination which I know( eg. adding a /" etc).
This line in below code is causing problem.
<html:link action="<bean:write name="link"
property="linkURL" />" >
can anyone help me to fix this. Appreciate your help.
<logic:iterate id="link" name="links" scope="session"
type="com.abc.app.DTO.HyperLink">
<tr>
<td align="left" width="10"><img src="/img/s.gif"
width="10" height="1" alt=""></td>
<td align="left" valign="top" width="10"
class="color003366"><span
style="font-weight:bold">»</span></td>
<td align="left" width="130">
<html:link action="<bean:write name="link"
property="linkURL" />" >
<bean:write name="link" property="linkDesc" />
</html:link>
</td>
</tr>
</logic:iterate>
The problem is the way you're nesting JSP tags.Y ou can't use a JSP tag
as the value of an attribute on another JSP tag; it's not valid syntax.
Try one of these solutions instead:
JSTL:
<html:link action=${link.linkURL}"/>
JSP-only:
<html:link>
<jsp:attribute name="action">
<bean:write name="link" property="linkURL"/>
</jsp:attribute>
</html:link>
There are other solutions as well, but one of those should get you going.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]