You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jishnu Viswanath <ji...@tavant.com> on 2008/07/13 10:07:48 UTC

Struts Text & Property together(s:text and s:property

Hi all,
	I would like to achieve something like this <s:text name=<s:
property value="someProperty" /> />

I know this code is not going to work; in short the name that should
come is inside a property, 

Eg:-
someProperty = "my.text.label"
<s:property value=" someProperty "/> gives me my.text.label

<s:text name="my.text.label"/> give me the value I wanted.
But how can I get both at same time?

Any one has any idea?

PS: I am using struts 2 :)


Regards,

Jishnu Viswanath


Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. If you have received this in error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies 
may be subject to our monitoring procedures.


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


Re: Struts Text & Property together(s:text and s:property

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Jishnu Viswanath wrote:
> Hi all,
> 	I would like to achieve something like this <s:text name=<s:
> property value="someProperty" /> />
>
>   
If your action extends ActionSupport, or implements TextProvider, or a 
TextProvider is in the ValueStack, then you can call one of the various 
getText() methods to access resources.

Something like the following should work:

<s:property value="getText(someProperty)"/>

ie. evaluate someProperty, then invoke the getText(String) method to get 
the resource with that name.



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