struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan Zhu <yan....@ipacc.com>
Subject Re: question about ActionErrors
Date Sun, 13 Jul 2003 02:48:20 GMT

I like all the features currently implemented in the PropertyMessageResources.
It just seems a bit odd to me that the only way implemented is to look
for the property file in the classpath, and you don't have a way to specify
the path to the file. Is there an example of extending that class for your own
use
anywhere I can take a look at?

thanks!

yan


Jing Zhou wrote:

> ----- Original Message -----
> From: "Yan Zhu" <yan.zhu@ipacc.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Saturday, July 12, 2003 9:10 AM
> Subject: Re: question about ActionErrors
>
> >
> > I might be wrong about this, but doesn't this still force it to look for
> files
> > in app's classpath, such as in directories like WEB-INF/classes or /lib ?
> >
> > I need to load the property file from WEB-INF/conf/myapp.message,
> > how would I do that?
>
> You might have to create a custom version of PropertyMessageResources.
> In the class, you use ServletContext.getResourceAsStream to obtain a
> input stream with a context relative path and then use it to initialize the
> properties.
>
> Before you go down that path, evaluate the benefits of the current
> PropertyMessageResources. It allows you to group message resources
> into different packages. It is easy to tell, say a message format like
>
> key34= Input {0} is invalid
>
> is specified for which classe and in which package. This is very useful when
> your project get larger. Of course, there are other better organization
> structures. Some people think storing message resources in database
> is a good way. I am interested in that direction for larger projects.
>
> >
> > thanks
> >
> > yan
> >
>
> Jing
> Netspread Carrier
> http://www.netspread.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


Mime
View raw message