struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Roughley <...@fdar.com>
Subject Re: [S2] <s:text> issue
Date Fri, 02 Feb 2007 20:07:04 GMT
I think you may be confused, you say

The value of myKey is "some.resource.key", and in the
property file I have:

    some.resource.key = Some text

In fact, "some.resource.key" is the key and "some text" is the value.

Try -

<s:text name="some.resource.key" />


/Ian

-- 
>From Down & Around, Inc.
Innovative IT Solutions
Software Architecture * Design * Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web:      www.fdar.com  
email     ian@fdar.com  
phone:    617.821.5430
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Djordje Trifunovic wrote:
> Hi,
>
>  
>
> Using Struts2 (2.0.5 snapshot) in a project, I hit the following problem: I
> have a resource bundle key that I need to use with <s:text> tag to retrieve
> a text from my resource bundle. The name of the key is in a property myKey
> in the value stack. The value of myKey is "some.resource.key", and in the
> property file I have:
>
>  
>
>     some.resource.key = Some text
>
>  
>
> I tried:
>
>  
>
>     <s:text name="#myKey" />
>
>  
>
> but that doesn't work as I expected. Instead of getting "Some text" on my
> page, or at least "some.resource.key", I get "#myKey" instead. Just to be
> sure everything is ok in the value stack, I tried:
>
>  
>
>     <s:property value="#myKey" />
>
>  
>
> And that returns "some.resource.key", as expected. Am I missing something
> here?
>
>  
>
> Thanks,
>
> Djordje Trifunovic
>
>  
>
> PS. I am sorry if the issue was already discussed. I didn't find it quickly
> searching through archive.
>
>  
>
>
>   

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


Mime
View raw message