struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhou" <>
Subject Re: question about ActionErrors
Date Sun, 13 Jul 2003 02:06:29 GMT

----- Original Message ----- 
From: "Yan Zhu" <>
To: "Struts Users Mailing List" <>
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
> 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

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

Netspread Carrier

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message