struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Fesler" <>
Subject RE: custom tag as attribute of another custom tag
Date Wed, 04 Jul 2001 15:00:45 GMT
I had the same problem.

That's why I wrote a new link tag. This tag allows to define the parameters
using nested tags.

You can refer to my last posting in the thread <Multiple request parameter
for the html:link tag> if you want some more information.


> -----Message d'origine-----
> De : []
> Envoyé : lundi 2 juillet 2001 16:08
> À :
> Objet : custom tag as attribute of another custom tag
> Can someone tell me if it is possible to have a custom tag as an
> ATTRIBUTE of another custom tag?  I have been unable to find the answer
> to this question.  I am trying to use a <bean:write/> within the "href"
> attribute of <html:link/> in order to dynamically get the value of
> "Param3" which is in bean "ampp".  See below:
> <html:link href="<bean:write
> name="ampp" property="AMTRSD00.trDept"/>">
> 	<bean:message key="myLinkText"/>
> </html:link>
> The compile error I get is:
> "javax.servlet.jsp.JspException: You must specify a name attribute if
> the property attribute is present"
> It seems to me that this would be an fairly common requirement of custom
> tags.  I could modify the <html:link/> tag to always evaluate the "href"
> attribute to see if the <bean:write/> tag is present and if so retrieve
> that value -- but that doesn't sound very clean.  I am trying to use
> custom tags as much as possible and Java scriptlets as little as
> possible.  I could use the standard HTML <a/> instead of <html:link/> or
> else continue to use <html:link/> and retrieve the value with Java
> scriptlet -- neither of which is ideal.
> Thanks for your help.
> Brennan O'Shea

View raw message