You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Security Management <li...@secmgmt.com> on 2009/03/04 21:52:37 UTC
Propery way to change getText()'s source
I would like the getText() methods to pull information from a database
"Meaning" table.
Would the proper way to do that be to subclass ActionSupport and
re-implement that interface? Then, all my actions inherit from
MyActionSupport, and the getText stuff is different.
If that's not the way to do it, what's the best way?
Thanks,
Mike.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Propery way to change getText()'s source
Posted by Wes Wannemacher <we...@wantii.com>.
On Wednesday 04 March 2009 15:52:37 Security Management wrote:
> I would like the getText() methods to pull information from a database
> "Meaning" table.
>
> Would the proper way to do that be to subclass ActionSupport and
> re-implement that interface? Then, all my actions inherit from
> MyActionSupport, and the getText stuff is different.
>
> If that's not the way to do it, what's the best way?
>
The best way would be to write your code in a class that implements
TextProvider -
http://struts.apache.org/2.x/struts2-
core/apidocs/com/opensymphony/xwork2/TextProvider.html
Then, specify your class as the text provider bean in your app.
-Wes
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org