You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Djordje Trifunovic <dj...@cisco.com> on 2007/02/02 21:01:21 UTC

[S2] issue

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.

 


Re: [S2] issue

Posted by Ian Roughley <ia...@fdar.com>.
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