wood burning stoves*
The moose likes Tomcat and the fly likes Why to extract war file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
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: 41052
    
  43
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).


Ping & DNS - my free Android networking tools app
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://aspose.com/file-tools
 
subject: Why to extract war file?
 
Similar Threads
change the image in the interface
how to create war files
Tomcat 4 not deploying WARs
war file
How to create a war file