struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: struts: JSP expression not evaluated
Date Tue, 25 Mar 2003 18:24:15 GMT

<snip/>
                <!-- the link won't read "blah.do?arg=1 -->
>                 <html:link href="blah.do?arg=<%=var%>">
>                         Link
>                 </html:link>
>         </body>
> </html>

The href attribute must either *entirely* be a run time expression (<%=..%>) or *entirely*
a literal. Hence the one below works

> 
> This works:
> 
> 
> <%
>     int var = 1;
>     String href = "blah.do?arg=" + var;
> %>
>     <html:link href="<%=href%>">
> 

You can alternatively write:

  href="<%="blah.do?arg="+var%>"

Or you can use the paramId etc properties of <html:link> to avoid all this mess!

Sri

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message