Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Struts: properties in external files, reloading it after changes

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I need to have the Property Files outside a Web-Application. This could be stored on an URL or in the File System from the server. The idea is to enable an "easy" update on the Property Files. After an update, the Property Files should be loaded again and show correctly, for example, on some JSP-Page.

A possible solution is to have a Timeout. When this time is reached, the Properties will be loaded again. Another possible could be to watch the Directory for changes and react when a changes come. But this is something complicated. I have select the first solution.

I have create my own PropertyMessageResources and PropertyMessageResourcesFactory Classes and put it on the Struts config files. I load the Property Files again when the Timeout is reached. Everything works fine. But after a reload in the JSP-Pages the messages will not be updated. Just when the server goes down and up again.

Are the Messages for the JSP-Pages cached somewhere? How can I show the new messages?

Please I need help on this issue (or maybe another solution).

Best Regards

ADS
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file which you have created is an XML file or simple text file.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're trying to reload the Struts Message Resources that are used in the <bean:message> tag, that's not the same as just reloading a properties file that you access through your own code.

Quite a few people have tried this -- most unsuccessfully. However, this thread should give you some information about some approaches that appear to have been successful.
 
Alfredo Delgado Sanchez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ram,

the file I created is a normal property file, a simple text file.

Best Regards

ADS
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic