aspose file tools*
The moose likes Java in General and the fly likes I need changes of xml file reflecting with out restart tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "I need changes of xml file reflecting with out restart tomcat" Watch "I need changes of xml file reflecting with out restart tomcat" New topic
Author

I need changes of xml file reflecting with out restart tomcat

Chintan H Patel
Greenhorn

Joined: Nov 17, 2010
Posts: 2
Hi,
In my application i am using quartz as daemon process in my application. In that all configuration is through one xml file. That xml file contains the delay, time of start services etc.
Right now that parameters in xml file is static given.

But now i need to control that parameters of xml file from one GUI (one JSP) page. I am able to change the parameter of xml file from JSP but it is not reflacting.
To reflect i need to restart the tomcat server. That's i not want.

Is it possible that we change the parameters and values from xml and will reflect without restarting tomcat server ?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

what would be best is that the application watches the XML file and reloads it on its own, if that is what the application requires.
you could add the file to the context watch list, but when that sees a change it would redeploy (and reload) the file but bouncing the context may not be the most elegant solution.
Aditya Kanitkar
Ranch Hand

Joined: Aug 08, 2009
Posts: 72
David O'Meara wrote:what would be best is that the application watches the XML file and reloads it on its own, if that is what the application requires.
you could add the file to the context watch list, but when that sees a change it would redeploy (and reload) the file but bouncing the context may not be the most elegant solution.


@David O'Meara : Should it be added into web.xml or struts-config.xml?

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I have done this by code in doGet which watches for a special keyword - when found it causes a re-reading of the properties, xml, whatever configuration file and generates a HTML page stating the result. It is easy to then create a static HTML file on your own system with the required FORM or plain link.

Bill
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
. . . and welcome to JavaRanch
Alex Hurtt
Ranch Hand

Joined: Oct 26, 2010
Posts: 98
I'm not a guru at it or anything but would this be the kind of thing JMX was designed to handle?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I need changes of xml file reflecting with out restart tomcat