Is there a way to save files to a directory which will survive!_NEWLINE_!upgrades to the webapp?
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, October 18, 2001 11:01 AM

[Currently, if I save files inside the deployed webapp or WEB-INF directory, they will be erased when I upgrade the webapp.] I am developing a webapp which stores its preferences in the WEB-INF folder. These preferences are created runtime and used to configure the webapp. As I read myself through the documentation (tomcat 4.0) the only possible upgrade for a webapp is to replace the old war file and delete the webapp's folder and restart tomcat. But in this case all the saved preferences are lost! Is it possible to somehow "path" a webapp, modifying only the files belonging to the webapp? or, in which folder should a webapp store some private preferences to not to be   More>>

[Currently, if I save files inside the deployed webapp or WEB-INF directory, they will be erased when I upgrade the webapp.]


I am developing a webapp which stores its preferences in the WEB-INF folder. These preferences are created runtime and used to configure the webapp.


As I read myself through the documentation (tomcat 4.0) the only possible upgrade for a webapp is to replace the old war file and delete the webapp's folder and restart tomcat.

But in this case all the saved preferences are lost!

Is it possible to somehow "path" a webapp, modifying only the files belonging to the webapp?

or, in which folder should a webapp store some private preferences to not to be deleted ?

thanks, Feri

   <<Less

Re: Is there a way to save files to a directory which will survive!_NEWLINE_!upgrades to the webapp?

Posted By:   Marcel_Offermans  
Posted On:   Tuesday, November 20, 2001 12:14 PM

From what I understand (but I'm no expert on the Servlet / Web Application specification, you don't have a local store associated with each web application. That means you need to provide one outside of the WAR and use that.



I would write a simple storage service and package it separate from the WAR you provide and update regularly. Depending on the application server or framework you're deploying your application in, this could be an Enterprise JavaBean, a HTTP based service, a JINI service or an OSGi service. My point is that you should create an external service that stores and retrieves settings.

Re: How to update a webapp within Tomcat4.0 keeping some (config) files from its current version to new version?

Posted By:   Alex_Chaffee  
Posted On:   Thursday, October 18, 2001 04:38 PM

There was going to be some way to get access to a persistent directory with Servlets 2.3, but I'm not sure if that made it into the spec. I think it was going to be a property you could read?


I guess they punted :-(

Re: How to update a webapp within Tomcat4.0 keeping some (config) files from its current version to new version?

Posted By:   Alex_Chaffee  
Posted On:   Thursday, October 18, 2001 04:33 PM

Re: How to update a webapp within Tomcat4.0 keeping some (config) files from its current version to new version?

Posted By:   Ahmed_Alawy  
Posted On:   Thursday, October 18, 2001 01:40 PM

If I understood what you're saying correctly, you can war your current app and drop it into the webapps directory. You do not have to delete anything. I do not know how familiar are you with Tomcat, but you can cd into the app-directory and type jar cvf myapp.war *, this should create a war file of the current application. If the application will rewrite the configuration files when you restart then you have a problem.
About | Sitemap | Contact