You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vishal Seth <vi...@mastek.com> on 2006/10/16 13:44:17 UTC

Custom implementation for MessageResourcesFactory

Hi,
   I need to know what could be the suitable way of proving custom
implementation for the MessageResourceFactory. I have tried with 2 ways:

1) By Overriding ActionServlet and providing implementation for
initModuleMessageResources() and setting my own factory class rather
than the default one. In the factory class I override createResources()
to provide my implementation class.

2) By writing a new plug-in and setting the factory class as done in
method one.

I cannot think of any other options other than the two above specified.
Is there a better way to provide custom implementation or which one of
the above would be a better solution to implement?

Thanks
Vishal

MASTEK 
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from all computers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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


Re: Custom implementation for MessageResourcesFactory

Posted by Laurie Harper <la...@holoweb.net>.
Vishal Seth wrote:
> Hi,
>    I need to know what could be the suitable way of proving custom
> implementation for the MessageResourceFactory. I have tried with 2 ways:
> 
> 1) By Overriding ActionServlet and providing implementation for
> initModuleMessageResources() and setting my own factory class rather
> than the default one. In the factory class I override createResources()
> to provide my implementation class.
> 
> 2) By writing a new plug-in and setting the factory class as done in
> method one.
> 
> I cannot think of any other options other than the two above specified.
> Is there a better way to provide custom implementation or which one of
> the above would be a better solution to implement?

The preferred way to do this is through configuration. Set the 'factory' 
attribute of your 'message-resources' element to the fully qualified 
class name of your implementation of MessageResourcesFactory. See the 
documentation comments in struts-config*.dtd for more details.

L.


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