Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat redeployment - options

 
San Muthu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have sample.war deployed and running in tomcat. I have some contents added to webapps/sample/data. When i redeploy(auto) any new war i do not want to overwrite this folder (data). is it possible with tomcat?
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santhi Muthusamy wrote:Hi,

I have sample.war deployed and running in tomcat. I have some contents added to webapps/sample/data. When i redeploy(auto) any new war i do not want to overwrite this folder (data). is it possible with tomcat?


application data should be in a directory on the same level as webapps so that it is not erased when you redeploy your app.
 
San Muthu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply.

The project code seems to be legacy code.. So i did not want touch anything there. Is there any way in tomcat to achieve this?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is reason #2 why you should never attempt to write data to your WAR.

Reason #1 is that in a pure J2EE implementation, the WAR is a ZIP file and attempting to open and write it as a file won't work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic