• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i place localization properties file otherthan WEB-INF/classes  RSS feed

 
Zaid Ansari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on localization for 2 languaes en and fr.
my web.xml contains following
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.localizationContext
</param-name>
<param-value>
Application
</param-value>
</context-param>
and my poroperties files(Application_en.properties & Application_fr.properties ) are placed at WEB-INF/classes folder.

Every thing was working fine but i made an Admin Secstion from where I want to mange that properties file. but as soon as i update my property file using my Admin Section ServletContrext gets DESTROYED. i thing thins is because changes are made in WEB-INF folder.
My Question is: Is there anyway i can place my properties file somewhere else e.g along with my JSPs.
Regards,
Zaid Ansari
SCJP,SCWCD
 
Zaid Ansari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Continuation with my first post.
if i use using JSTL setBundle tag instead of my setting in web.xml like that
<fmt:setBundle basename="Application" var="loadedBundle" scope="application"/>
than is there any way i can reload my Application.properties.
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.....
Zaid
 
Zaid Ansari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally i got a solution that resolved my problem. it'shere 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.
Zaid Ansari


[BSouther: Added UBB CODE tags]
[ August 18, 2007: Message edited by: Ben Souther ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!