You can't nest a custom tag in an attribute of another custom tag. It's
illegal JSP syntax. You have (at least) a couple of options, depending
on what level of the servlet spec you're using:
<html:link>
<jsp:attribute name="href">
<bean:write name='element' property='id'/>
</jsp:attribute>
</html:link>
should work everywhere. An alternative if you have JSTL available:
<bean:define id="href" name='element' property='id'/>
<html:link href="${href}" ...
And if not:
<bean:define id="href" name='element' property='id'/>
<html:link href="<%= href %>" ...
L.
rahul wrote:
thanks for the help
see inline comments ####
-----Original Message-----
From: SÅ‚awek Tuleja [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 24, 2005 1:57 PM
To: Struts Users Mailing List
Subject: Re: <bean:write> tag within <html:link> tag
rahul wrote:
Hi all,
Can anyone tell me how to use <bean:write> tag inside <html:href>
I tried it like:
<logic:iterate id="element" name="myBeanList">
<html:link href="/someAction.do?id=<bean:write name='element'
property='id>" >
<bean:write name="element" property="idDescription" />
</html:link>
</logic:iterate>
but its not working, it is generating the following html
<a href="http://localhost:8080/someAction.do?id=<bean:write
name='element'
property='id'>">My Desc </a>
what's the correct way of doing this?
--RahulJoshi
__________ NOD32 1.1212 (20050908) Information __________
This message was checked by NOD32 antivirus system.
http://www.nod32.com
Hi Rahul
you forgot about /> after property="id"
#### sorry for that
try this:
<html:link href="/someAction.do?id=<bean:write name='element'
property='id' />" ><bean:write name="element"
property="idDescription" /></html:link>
or
<a href="/someAction.do?id=<bean:write name="element"
property="id" />"><bean:write name="element"
property="idDescription" /></a>
##### second one works perfectly (though I need to remove / from href value)
but first one, (<html:link>) is still not working
any idea?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]