tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Bau <Alec....@msdw.com>
Subject Re: Using expressions in tag attributes
Date Tue, 15 Aug 2000 17:53:03 GMT
Rachel Greenham wrote:

    >ie: to extend my above example:
    ><myprefix:GetVariable name="<%=request.getParameter("name")%>"/> will
fail.

You should use single quotes in cases like these:

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

Alec


Rachel Greenham wrote:

> 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