Does your implementation support all resources or do you only want to have
resources used by html:errors to be sourced from the database? Does your
database schema support i18n? Does it allow multiple webapps to share the
same table or do they each need their own copy? Are the key value pairs
cached in memory or do you hit the database every time?

Maybe you should submit this to struts-dev for review. If it's worth adding
to Struts then we could write a sample Webapp that maintained the database
table and assisted with identifying keys that need to be translated.

Hal

> -----Original Message-----
> From: Muthu Kannappan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 23, 2001 7:13 PM
> To: [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 03:52 AM
> To: '[EMAIL PROTECTED]'
> 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:  [EMAIL PROTECTED]
>
>
> -----Original Message-----
> From: Muthu Kannappan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 23 May 2001 8:42
>
>
> To: [EMAIL PROTECTED]
> 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
>

Reply via email to