You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Sukachevin, Stoehr" <st...@commerceone.com> on 2001/05/23 16:33:58 UTC

RE: tag

Sounds like you want the application resource bundle to be an instance of
your MessageResource subclass.  In that case, you should just have to
specify your MessageResourcesFactory subclass fully qualified name for the
"factory" init parameter of the ActionServlet (see
http://jakarta.apache.org/struts/userGuide/building_controller.html#dd_confi
g_servlet).


-- Stoehr


-----Original Message-----
From: Muthu Kannappan [mailto:kannappan123@usa.net]
Sent: Wednesday, May 23, 2001 07:13 PM
To: struts-dev@jakarta.apache.org
Subject: RE: <html:errors/> tag


Hi
I have written a subclass of org.apache.struts.util.MessageResources  and
also
a subclass of org.apache.struts.util.MessageResourcesFactory,
and made my implementation so that when <html:errors/> tag is called it gets
the error message from my database instead of the ActionResources.properties
file.

But the problem that I have got now is, How do I set that up in Struts and
which XML file or other file have I to modify.
Could you please help me out in this.

Thanks
Kanna




 
You can subclass org.apache.struts.util.MessageResources to provide your own
"database" implementation of a resource bundle (as opposed to the common
"properties" implementation via
org.apache.struts.util.PropertyMessageResources), put an instance of your
subclass in a servlet context (application-scope) attribute, and then use
the <html:errors> tag's "bundle" attribute to specify the name you gave to
the servlet context (application-scope) attribute.

At least that should be the theory behind it, though I have not done it
myself.

-- Stoehr

P.S.  You could also have the application resource bundle be an instance of
your MessageResources subclass by creating a subclass of
org.apache.struts.util.MessageResourcesFactory that creates instances of
your MessageResources subclass, and then specify the new factory in the
ActionServlet's "factory" init parameter.


-----Original Message-----
From: SESHADRI Sudarshan [mailto:Sudarshan_Seshadri@rta.nsw.gov.au]
Sent: Tuesday, May 22, 2001 03:52 AM
To: 'struts-dev@jakarta.apache.org'
Subject: RE: html:errors/> tag


Hi Kanna

please send me the answer if u find it.

thanks

Sudarshan

> tks
> 
> Sudarshan
> Tel:  office  : 9218 6823    Fax: 9218 6455 / 9218 6916
> Email:  Sudarshan_Seshadri@rta.nsw.gov.au


-----Original Message-----
From: Muthu Kannappan [mailto:kannappan123@usa.net]
Sent: Wednesday, 23 May 2001 8:42


To: struts-dev@jakarta.apache.org
Subject: html:errors/> tag


Hi
I have been trying to use struts and wanted to use the <html:errors/> tag.
I wanted to the error messages to be read from a database instead of the 
ActionResources properties file. Could you let me know 
what exactly I am suppose to do to achive that. 
I wanted to changed the code at the place where it was looking for the
properties files and make it look into the database.
Could any one suggest me how to do that or has anybody done that already.

Thanks
Kanna


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1