File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Why to extract war file? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Why to extract war file?" Watch "Why to extract war file?" New topic
Author

Why to extract war file?

smitha rajgopal
Greenhorn

Joined: Sep 22, 2005
Posts: 14
Hello,
I was asked this question in an interview.Why should we create a war and extract the war to webapps.Why not copy the folder directly and run.Please le t me know the answer

Thanks,
Smitha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
For easier distribution - it's just a single file to copy. We have a web app that has more than 34000 files; copying those over the network would take a long time.

It's also more orderly to initialize. The servlet engine knwos what to do with a war file, while if you copy individual files, it might try to start initializing the web app as soon as it sees the web.xml file, which may be too soon (because some files are still missing).


Android appsImageJ pluginsJava web charts
Imran Jack
Ranch Hand

Joined: May 05, 2008
Posts: 31
how can we extract war file ??? I had tried winRAR, on right-click it give options to further compress it and does not have options like extract etc.
Imran Jack
Ranch Hand

Joined: May 05, 2008
Posts: 31
eureka,
>jar -xvf struts2-mailreader.1.1.war
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You don't need to extract them.
Tomcat will do it automatically.

Simply drop your war file in the tomcat/webapps directory and Tomcat will take care of the rest.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Why to extract war file?
 
Similar Threads
Tomcat 4 not deploying WARs
How to create a war file
war file
how to create war files
change the image in the interface