Re: [Off Topic] File Changed Listener?
Have the admin app send a request to the user app that tells it to reload the file. Like the reload command in Struts 1.0.x For security, you might be a timestamp (version) into the file and include that with the request. This would ensure that the file only gets loaded once and can't be easily spoofed. The thing to watch with application-scope critters is threading issues. You need to consider what happens if the bean changes on some user in the middle of a process. -Ted. Matt Raible wrote: I am working on a project where we have two webapps, one is a admin app, the other is for users. Both are developed in Struts. The users app loads configuration settings from an XML file at startup and puts a bean into the application's scope. The admin app has an interface to change this file and save the XML file. So is it possible to develop a File Listener that notifies the user app when this file as changed, so I can reload it? If not, how would you experts recommend accomplishing this? Maybe the admin app calls a servlet to reload the Configuration servlet? Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US co-author, Java Web Development with Struts Order it today: http://husted.com/struts/book.html -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [Off Topic] File Changed Listener?
To go even more geek: use JMX (ManagedBeans...) regards Alexander -Original Message- From: Tero P Paananen [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 4. September 2002 20:07 To: Struts Users Mailing List Subject: RE: [Off Topic] File Changed Listener? I am working on a project where we have two webapps, one is a admin app, the other is for users. Both are developed in Struts. The users app loads configuration settings from an XML file at startup and puts a bean into the application's scope. The admin app has an interface to change this file and save the XML file. So is it possible to develop a File Listener that notifies the user app when this file as changed, so I can reload it? If not, how would you experts recommend accomplishing this? Maybe the admin app calls a servlet to reload the Configuration servlet? Have the admin app notify the user app of the change: * with JMS (or any other type of) messaging * by changing a database flag that the user app monitors with a scheduled job or on-demand whenever the settings are used, which ever way is better for your app * by calling a servlet / web service / CGI / whatever on the user app Or have the user app poll the file for changes with a scheduled task. I'd use JMS, cause I'm a geek and I want to play with cool technology and I haven't done that before :) Use the approach you're most familiar with, can implement within the constraints of your project schedule/cost and know that other developers can maintain when you leave. -TPP -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [Off Topic] File Changed Listener?
Use a database trigger. Mark -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 1:46 PM To: [EMAIL PROTECTED] Subject: [Off Topic] File Changed Listener? I am working on a project where we have two webapps, one is a admin app, the other is for users. Both are developed in Struts. The users app loads configuration settings from an XML file at startup and puts a bean into the application's scope. The admin app has an interface to change this file and save the XML file. So is it possible to develop a File Listener that notifies the user app when this file as changed, so I can reload it? If not, how would you experts recommend accomplishing this? Maybe the admin app calls a servlet to reload the Configuration servlet? Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [Off Topic] File Changed Listener?
I am working on a project where we have two webapps, one is a admin app, the other is for users. Both are developed in Struts. The users app loads configuration settings from an XML file at startup and puts a bean into the application's scope. The admin app has an interface to change this file and save the XML file. So is it possible to develop a File Listener that notifies the user app when this file as changed, so I can reload it? If not, how would you experts recommend accomplishing this? Maybe the admin app calls a servlet to reload the Configuration servlet? Have the admin app notify the user app of the change: * with JMS (or any other type of) messaging * by changing a database flag that the user app monitors with a scheduled job or on-demand whenever the settings are used, which ever way is better for your app * by calling a servlet / web service / CGI / whatever on the user app Or have the user app poll the file for changes with a scheduled task. I'd use JMS, cause I'm a geek and I want to play with cool technology and I haven't done that before :) Use the approach you're most familiar with, can implement within the constraints of your project schedule/cost and know that other developers can maintain when you leave. -TPP -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]