You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Richards <gr...@cyber4.org> on 2001/06/08 10:54:23 UTC

Re: JSP expressions inside custom tags

try

	<html:link href="<%= \"/\" + name + \"/index.jsp\" %>">

You need to have the <%= %> present the whole string, not just the single part.


At 10:56 AM 8/06/01 +0200, you wrote:
>Hi!
>
>I am evaluating struts for a new project. One problem I wasn't able to solve
>was the integration of JSP expressions inside the attributes of
>custom tags.
>
>My code looks like this:
>
><logic:iterate id="pelement" name="MyBean" property="pelements">
> <% String name = ((PElement)pelement).getName(); %>
> <html:link href="/<%= name %>/index.jsp">
>                   ^^^^^^^^^^^ Here is my problem!
>    <bean:write name="pelement" property="longname"/>
> </html:link><br />
></logic:iterate>
>
>The links always contain the <%= name %> string instead of the evaluated
>expression. I tried it with different quoting techniques but without luck.
>
>What is the correct solution here?
>
>TIA,
>Erich
> 
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html