You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by je...@attbi.com on 2002/03/19 17:48:27 UTC

Properties

I have noticed that the example app uses the props file 
to access strings such as page text and page titles.

Are these props cached?  If so, when are they reloaded?  
If they aren't reloaded, what is the point since you 
need to restart the container to re-cache them?  You may 
as well just edit the JSP page.  Or maybe set the 
controller sevlet, which takes them as an init-param, to 
re-cache them from time to time?

Thanks for your input,
Jeff

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Properties

Posted by Ted Husted <hu...@apache.org>.
Struts uses the standard resource properties files, which can also be
made part of a localized resource bundle. 

http://java.sun.com/docs/books/tutorial/i18n/resbundle/concept.html

Some containers reload these automatically, others do not. 

Besides the localization features the resource provides, they are also a
handy way to share string constants between components. For example, the
Commons-Validator can share resource strings with the Struts framework.
It also lets you share resoruces internally.  The Validator can take the
field label from the resource and merge that into a error message
regarding the field, without messing about with StringBuffers and such.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


jeffhaenn@attbi.com wrote:
> 
> I have noticed that the example app uses the props file
> to access strings such as page text and page titles.
> 
> Are these props cached?  If so, when are they reloaded?
> If they aren't reloaded, what is the point since you
> need to restart the container to re-cache them?  You may
> as well just edit the JSP page.  Or maybe set the
> controller sevlet, which takes them as an init-param, to
> re-cache them from time to time?
> 
> Thanks for your input,
> Jeff
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>