You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Moacyr Prado <mw...@gmail.com> on 2009/02/04 01:56:08 UTC

Tag s:url

Hi,

I`m using a tag url but this tag are not evaluate a expression
"[0].getActionsName" on action parameter.Is it normal?

example:

<s:url var="myVar" action="[0].getActionName()"/>
<s:a href="%{myVar}"><s:property value="[0].getLinkText()" /><s:a/>

The last Action called has getActionName() and getLinkText() methods.

In browser shows http://localhost/App/[0].getActionName[]

Can anybody help me?

Re: Tag s:url

Posted by Dave Newton <ne...@yahoo.com>.
Moacyr Prado wrote:
> I`m using a tag url but this tag are not evaluate a expression
> "[0].getActionsName" on action parameter.Is it normal?
> 
> example:
> 
> <s:url var="myVar" action="[0].getActionName()"/>
> <s:a href="%{myVar}"><s:property value="[0].getLinkText()" /><s:a/>
> 
> The last Action called has getActionName() and getLinkText() methods.
> 
> In browser shows http://localhost/App/[0].getActionName[]

I'm not sure that the "action" attribute is evaluated; there was a 
recent thread about this but I don't recall the outcome. You could 
always try to force evaluation via %{}.

Even if it's not evaluated, though, for future reference the OGNL 
expression could be noticeably shorter: "actionName" and "linkText".

Dave


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