You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Bliznak <bl...@rogers.com> on 2009/07/10 17:23:15 UTC

Passing runtime exp into tag

Hi all,
translating portion of old code which was using S1 and Tiles and 
ran into problem.

There is one tile representing form which is being used on almost all screens.
One doesn't want to write same tile over and over again since only name
of the action differs.

Existing code used this:

// define name of the action to be a passed from parent tile
<tiles:useAttribute name="formAction" />

then it was used like this:

<html:form action="<%= formAction.toString() %>" ......


I've changed this to use S2 tags:

<s:form action="<%= formAction.toString() %>"  .........

and jsp compilers complains:


JSPG0227E: Exception caught while translating /layout/formLayout.jsp:  
/layout/formLayout.jsp(11,1) --> JSPG0124E: Custom tag attribute action 
cannot be runtime expression. value: "[%= formAction.toString() %]"

Any ideas how to solve it?

Thanks,

Peter.

Re: Passing runtime exp into tag

Posted by Peter Bliznak <bl...@rogers.com>.
Figured it out, forget it.




________________________________
From: Peter Bliznak <bl...@rogers.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Friday, July 10, 2009 11:23:15 AM
Subject: Passing runtime exp into tag

Hi all,
translating portion of old code which was using S1 and Tiles and 
ran into problem.

There is one tile representing form which is being used on almost all screens.
One doesn't want to write same tile over and over again since only name
of the action differs.

Existing code used this:

// define name of the action to be a passed from parent tile
<tiles:useAttribute name="formAction" />

then it was used like this:

<html:form action="<%= formAction.toString() %>" ......


I've changed this to use S2 tags:

<s:form action="<%= formAction.toString() %>"  .........

and jsp compilers complains:


JSPG0227E: Exception caught while translating /layout/formLayout.jsp:  
/layout/formLayout.jsp(11,1) --> JSPG0124E: Custom tag attribute action 
cannot be runtime expression. value: "[%= formAction.toString() %]"

Any ideas how to solve it?

Thanks,

Peter.