You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Harland <ha...@yahoo.com> on 2007/04/05 11:57:55 UTC
Accessing message resources
Hi,
How do you use ognl to access resources outside of a class that extends ActionSupport. eg the struts 2 equivalent to Resources.getMessage but
getText() instead
Thanks
Dave.
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Accessing message resources
Posted by Dave Newton <ne...@yahoo.com>.
--- David Harland <dh...@ufi.com> wrote:
> In struts 1 you could access the resource bundles
> using Resources.getMessage from any class. How do
you
> do the same in struts 2 using getText.
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#getTexts(java.lang.String)
That returns a regular ResourceBundle with which you
can play whatever games you want.
d.
____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Accessing message resources
Posted by David Harland <dh...@ufi.com>.
In struts 1 you could access the resource bundles using
Resources.getMessage from any class. How do you do the same in struts 2
using getText.
-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: 05 April 2007 12:45
To: Struts Users Mailing List
Subject: Re: Accessing message resources
--- David Harland <ha...@yahoo.com> wrote:
> How do you use ognl to access resources outside of a class that
> extends ActionSupport. eg the struts 2 equivalent to
> Resources.getMessage but
> getText() instead
I'm not aware that you'd normally use OGNL for that; the <s:text.../>
and <s:i18n.../> tags are what (I
think?) would be used on a JSP page.
The last I heard there were some issues with <s:i18n.../> for 2.0.6;
searching JIRA may shed some light on current status.
d.
________________________________________________________________________
____________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo!
Games.
http://videogames.yahoo.com/platform?platform=120121
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
- ------
ML {UFI}
______________________________________________________________________
Ufi Limited
Registered in England No. 3980770
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
learndirect Solutions Ltd
Registered in England No. 5081669
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
UFI Charitable Trust
Registered in England No. 3658378
Registered Charity No. 1081028
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Accessing message resources
Posted by Dave Newton <ne...@yahoo.com>.
--- David Harland <ha...@yahoo.com> wrote:
> How do you use ognl to access resources outside of a
> class that extends ActionSupport. eg the struts 2
> equivalent to Resources.getMessage but
> getText() instead
I'm not aware that you'd normally use OGNL for that;
the <s:text.../> and <s:i18n.../> tags are what (I
think?) would be used on a JSP page.
The last I heard there were some issues with
<s:i18n.../> for 2.0.6; searching JIRA may shed some
light on current status.
d.
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org