struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick van Leuveren <patr...@info.nl>
Subject RE: custom tag as attribute of another custom tag
Date Mon, 02 Jul 2001 14:47:43 GMT
The problem you are facing is caused by the fact that you use double quotes
in both the enclosing tag and the enclosed tag. This way, the parser cannot
determine whether the seconde "-character it encounters matches the first to
close it, or opens a nested attribute value as you intend.

Try to use single quoting (') in your <bean:write > and enjoy the behaviour.
So :

 <html:link href="ui.do?Param1=123&Param2=N&Param3=<bean:write name='ampp'
property='AMTRSD00.trDept'/>">
 <bean:message key="myLinkText"/>
 </html:link>

The bean:message tag is not nested, so there is no need to change this one.

Patrick



-----Original Message-----
From: Brennan OShea [mailto:Brennan.OShea@alltel.com]
Sent: Monday, July 02, 2001 4:45 PM
Subject: RE: custom tag as attribute of another custom tag


True.  That was the first thing I checked but the rtexprvalue is set to
"true" already and it doesn't make any difference:

<tag>
  <name>link</name>
    <attribute>
      <name>href</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
    </attribute>

Thanks again!

-----Original Message-----
From: struts-dev@jakarta.apache.org at INTERNET
[mailto:IMCEACCMAIL-struts-dev+40jakarta+2Eapache+2Eorg+20at+20INTERNET@
alltel.com]
Sent: Monday, July 02, 2001 9:27 AM
To: OShea, Brennan; struts-dev@jakarta.apache.org at INTERNET
Subject: RE: custom tag as attribute of another custom tag


The spec says:  rtexprvalue <=> scriptlets

Wellington

-----Original Message-----
From: Taylor Cowan [mailto:tcowan@silverstream.com]
Sent: Monday, July 02, 2001 4:27 PM
To: struts-dev@jakarta.apache.org
Subject: Re: custom tag as attribute of another custom tag


I thought that you can use a custom tag as an attribute value for
another
tag, provided the attribute is designated within the TLD file as being
<rtexprvalue>true</rtexprvalue>.

Taylor

----- Original Message -----
From: "Lacerda, Wellington (AFIS)" <Wellington.Lacerda@fao.org>
To: <struts-dev@jakarta.apache.org>
Sent: Monday, July 02, 2001 9:07 AM
Subject: RE: custom tag as attribute of another custom tag


> No, a custom tag is not admissible as a tag attribute.
> You can pass your attributes in a Map.
>
> Wellington
>
> -----Original Message-----
> From: Brennan.OShea@alltel.com [mailto:Brennan.OShea@alltel.com]
> Sent: Monday, July 02, 2001 4:08 PM
> To: struts-dev@jakarta.apache.org
> Subject: 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="ui.do?Param1=123&Param2=N&Param3=<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

Mime
View raw message