File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "war file" Watch "war file" New topic

war file

Nelson Nadal
Ranch Hand

Joined: Jun 06, 2002
Posts: 170
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

Joined: Jul 11, 2001
Posts: 15302

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.

GenRocket - Experts at Building Test Data
Nelson Nadal
Ranch Hand

Joined: Jun 06, 2002
Posts: 170
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

Joined: Sep 19, 2003
Posts: 13
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:
subject: war file
It's not a secret anymore!