Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading .properties file.

 
Vijendra Babar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Struts 2.0 on Linux Platform.

Here is my Question:

I have written on JSP that shows list of all form name. On clicking this form name, all fields (Labels) are displayed which are present on corresponding .jsp page.

These label names are given in .properties file.
Now I want to change the content of this .properties file.
Which actually I have completed by rewritting .properties file.

But to see the change in my application I need to restart my Tomcat again, which I really don't want.

According to my knowledge, when ever application is loaded first contents of .properties file are loaded in memory, so even if we change the file contents, references prensent in memory are not changed. For that we compulsorly need to restart Web server.

Is there any alternative solution to see the changes made in .properties file?

Probably solution for this is to refresh entire memory or reload application. OR Through code restart application server.

Is this possible? or are there any alternative solution for this?

(I dont want to Restart Tomcat explicetly)
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been active in this forum for a year and a half now, and in that time several individuals have asked if there is a way to dynamically refresh the message resource bundle. I've seen a few post code that they tried that didn't work, but to my knowledge none of them have reported success with this.

Let's be clear on one thing, though. It is not necessary to restart the server in order to refresh the resouce bundle. It is only necessary to restart the web application. This is normally a considerably faster process than restarting the server.

Here's what I'd recommend: Most application servers have a batch process that will restart an application. I'd set up some sort of trigger process that detects when your .properties file has changed, and have that start the process that restarts the web application.
 
Vijendra Babar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what I'd recommend: Most application servers have a batch process that will restart an application. I'd set up some sort of trigger process that detects when your .properties file has changed, and have that start the process that restarts the web application.

Hi,

Thanks for your reply,

You have said about Batch Process in Application Server, does it mean .bat file? As in tomcat startup.bat is provided. Do we need to invoke this .bat file.

If it's something else then can you please tell it more clearly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic