You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Oleg Gorobets <fo...@opensymphony.com> on 2006/10/24 11:17:38 UTC

[Struts2] Message Resource configuration as it was in Struts1

In Struts 1 I have an ability to substitute standard java.util.ResourceBundle using with my own class which extends org.apache.struts.util.MessageResourcesFactory. It was very useful if someone wants to get their translations from database instead of using simple property files. 
In struts-config.xml:
[b]
<init-param>
        <param-name>factory</param-name>
        <param-value>org.foo.MessageResourcesFactory</param-value>
</init-param>
[/b]

I understand that I can manage it with "properties as classes" as suggested in "WebWork in Action" book by Jason Carreira, but I consider it will be more flexible to give a framework this additional feature.

I also created a corresponding issue in Struts 2 JIRA: https://issues.apache.org/struts/browse/WW-1481
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=47469&messageID=95868#95868


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


Re: [Struts2] Message Resource configuration as it was in Struts1

Posted by Oleg Gorobets <fo...@opensymphony.com>.
Yes I just was not sure that action object is placed to stack. If so, it would be a better idea to make your own BaseActionSupport class extending ActionSupport and override getText() methods. Then all your actions should extend your base action. Thanks for your advice!
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=47469&messageID=99437#99437


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


Re: [Struts2] Message Resource configuration as it was in Struts1

Posted by Don Brown <mr...@twdata.org>.
Yeah, I'm curious what the advantages of a new system would be over 
simply overriding Action.getText() and substituting your own lookup 
logic.  As an aside, Patrick keeps threatening to rework the 
localization so hopefully he'll tackle this request at the same time.

Don

Oleg Gorobets wrote:
> In Struts 1 I have an ability to substitute standard java.util.ResourceBundle using with my own class which extends org.apache.struts.util.MessageResourcesFactory. It was very useful if someone wants to get their translations from database instead of using simple property files. 
> In struts-config.xml:
> [b]
> <init-param>
>         <param-name>factory</param-name>
>         <param-value>org.foo.MessageResourcesFactory</param-value>
> </init-param>
> [/b]
>
> I understand that I can manage it with "properties as classes" as suggested in "WebWork in Action" book by Jason Carreira, but I consider it will be more flexible to give a framework this additional feature.
>
> I also created a corresponding issue in Struts 2 JIRA: https://issues.apache.org/struts/browse/WW-1481
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=47469&messageID=95868#95868
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
>   


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