• Post Reply Bookmark Topic Watch Topic
  • New Topic

updating of ResourceBundle not showing  RSS feed

 
Jesper Ottosson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using ResourceBundles for multilingual support on my site, and all text is in properties-files in the WEB-INF/classes directory.
My problem is that when the files are changed, the change isn't reflected on the page until some page has to be recompiled, and this doesn't necessarily happen after the file has been edited. Is there a way to tell the JSP-server to reload my classes directory when it's been updated?
btw i'm experiencing this on both Tomcat and Resin, newest versions
Thanks
Jesper
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper,
The Tomcat 4.0 config docs mention the attribute
"reloadable" on the "Context" element:
"Set to true if you want Catalina to monitor
classes in /WEB-INF/classes/ and /WEB-INF/lib
for changes, and automatically reload the web
application if a change is detected. This
feature is very useful during application
development, but it requires significant
runtime overhead and is not recommended for
use on deployed production applications.
You can use the Manager web application,
however, to trigger reloads of deployed
applications on demand."
So, unless you want every request to check every
file for changes, you're probably better off
1) "touching" the affected JSP when you compile
the new ResourceBundle or edit the properties
file.
2) Or use the Manager webapp to force the reload
yourself.
It's really not that big a deal, since you
presumably have some kind access to the server
to make the changes for your multilingual UI
support.
One note about the "latest" version. Tomcat 4.0.1
includes a new configuration setting in the
server.xml which wasn't in the server.xml with
4.0. The manager webapp uses an attribute "privileged"
in the <CONTEXT> element. This wasn't in 4.0, and
won't be in your server.xml if you upgraded from 4.0
to 4.0.1. If that's the case, you'll get a
SecurityException when you try to run the manager webapp.
Update your server.xml with an entry like
<Context path="/manager" docBase="manager"
debug="0" privileged="true"/>
to solve it. (If you installed 4.0.1 fresh, it should
have the required setting in place. This only affects
installations which allowed the 4.0.1 distribution to
updgrade an existing 4.0 install. Like mine.)
Then the url like
"servername"/manager/reload?path=/examples
should reload the examples, so plug in your app name.
Hope that helps,
Joe
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!