tags:

views:

620

answers:

2

I need to supply the key dynamically from the action to the text tag

<s:text name="<%=talkToUsInfo.messageKey%>" />  

but the name attribute on text tag is declared as false ( not sure why ? )

How do i get something like this working without changing the tld in the jar file ?

A: 

Take a look at OGNL

It might look like this

<s:text name="%{talkToUsInfo.messageKey}" />
tevch
+3  A: 

http://struts.apache.org/2.1.8.1/docs/text.html says:

Instead, you should use the getText() method that you inherit when your Action extends XWork's ActionSupport:

<s:textfield name="lastName" label="getText('person.lastName')" />

So I used e.g.

<s:property value="getText('status' + #someObject.currentStatus)" />

instead of "s:text" and it worked.

Leonid