This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes Can we reload property file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Can we reload property file?" Watch "Can we reload property file?" New topic

Can we reload property file?

Zaid Ansari

Joined: Dec 29, 2003
Posts: 10
if i use using JSTL setBundle tag like
<fmt:setBundle basename="Application" var="loadedBundle" scope="application"/>
than is there any way i can reload my file at runtime
Actually i want to reload my bundle when i update my property file from my admin section. File is updated but bundle returns old values.
even if i remove that variable using
<c:remove var="loadedBundle" scope="application"> and than try to reload the bundle it return the old values.
Anybody know any solution.....
[ August 17, 2007: Message edited by: Bear Bibeault ]
Zaid Ansari

Joined: Dec 29, 2003
Posts: 10
Finally i got a solution that resolved my problem. it's here for other who might need this.
If you are using Tomcat than you will need clearTomcatCache method otherwise clearMap(ResourceBundle.class, null, "cacheList"); is enough.
Also make sure that in server.xml the application you are using should not have reloadable="true", if it's there change it to reloadable="false".

Zaid Ansari


[BSouther: Added UBB CODE tags]
[ August 24, 2007: Message edited by: Ben Souther ]
I agree. Here's the link:
subject: Can we reload property file?