This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

war file

 
Nelson Nadal
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When is the time I will update the war file?
Is it everytime I have a change in JSP, class or lib? Thanks.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A WAR file is just an archived file of your web app. Basically, it's the same thing as zipping the file with winzip or gzip or something.
Anytime you make changes to your web app, you have to:
1. Create a new WAR file and deploy it into your application server
2. Deploy the files as they are into your application server
3. Copy just those changed files into your application server
And then restart your application server. It just depends on how your build environment is setup.
For example, I have an ANT build script which copies all my files to the appropraite file structure for the application server (TOMCAT in my case) and then the build script creates a WAR file and copies that file to the application server's webapps folder. Then I start/restart Tomcat and it deploys my WAR file into a folder with all the files just as they were placed in the WAR file.
And then when I make a change, I run my ANT build script again and we start all over with the process.
 
Nelson Nadal
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it's really an awkward thing to do if it's not in the script. Currently I'm using the sun one server(im really new to it and deploying a web appln). If there's an error I just changed the JSP and it right away reflect the changes I made. But if I changed something in the loose class(under WEB-INF) it seems it's not reacting to the change. So I need to recreate a war and redeploy the application?
 
R. Shellbay
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can change jsp's in the tomcat webapps folder, and see the changes immediately, as tomcat recompiles a jsp if it any changes. This is a good approach for small changes, but the disadvantage is the double book-keeping, when needing to update your original jsp-page as well.
Changes in java class files will demand a restart of tomcat, as the classloader need to be reset. So as a general rule..
1. If deploying a war with no changes in class-files, only jsp, then no restart is needed.
2. If changes in class-files--> restart
Also, as a comment. Learn ANT. It will automate your builds and save enourmous amounts of time in the end. Best thing ever happened....
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic