tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rachel Greenham <rachel.green...@enetgroup.co.uk>
Subject Re: Using expressions in tag attributes
Date Tue, 15 Aug 2000 17:04:48 GMT
Craig McClanahan wrote:
> 
> Rachel Greenham wrote:
> 
> > Should I be expecting this sort of thing to work?
> >
> > <%
> > String name="wibble";
> > %>
> > <myprefix:GetVariable name="<%=name%>"/>
> >
> > ie: using an expression in an attribute to a taglib tag. It doesn't
> > work, and I think I can see why, but as it does on HTML it would be
> > intuitive if it did.
> >
> 
> This should work if you declare, in your tag library descriptor file, that
> this attribute takes runtime expression values.  You would need something
> like this:
> 
>     <attribute>
>         <name>name</name>
>         <required>true</required>
>         <rtexprvalue>true</rtexprvalue>
>     </attribute>
> 
> Craig

Yeah, I noticed that myself a little while after posting. :-} However, see
my other postings, there do seem to be problems with this, in that things
don't work properly if the expression you're passing contains any string
constants (ie: quoted values)

ie: to extend my above example:

<myprefix:GetVariable name="<%=request.getParameter("name")%>"/> will fail.

-- 
Rachel

Mime
View raw message