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" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]