• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

What is a .war file?

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anybody give me a quick description of a .war file and why it is useful. I know I should just look it up myself but I like to get people's opinions on the usefulness of this stuff...
Thanks
Zac
 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WAR files are similar to jars, wherein they package all the resources.
Check out this link
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WAR file is a "Web Application Archive" -- it's comprised of all the pieces of your web application: JSPs, Servlets, Images, Static HTML, images, etc. -- and all packaged in a single snazzy little file.
Couple great advantages of a WAR file -->
1- Easily transferred from development to production machines (there aren't TONS of files to move and make sure they're all in the right order).
2- They're self describing -- it contains a deployment descriptor (web.xml) that tells the app server exactly what's in it and how its run.
3- It's standards based -- so you can (in theory) deploy this one WAR file onto ANY app server Vendor (HP, BEA, IBM etc).
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to make a war file? Is there a similar command such as war, like jar for making jar files?
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kyle,
I'm pretty sure you just jar it up, but specify the extension of the output file as .war.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Garann is correct.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup -- simply use the jar command but specify the name of the output file as something.war rather than .jar.
Also, there are some utilities out there that will help you to create WAR files and the deployment descriptors that go with them.
You can check out HP RadPak, it comes with the HP-Application Server. It also gives you the ability to look inside and even edit the contents of JAR/WAR files without exploding them.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As they're similar to .jar files, can WinZip open and extract .war files without problem?
Thanks,
Corey
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. The compression method is the same. The only difference is the file extension.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please explain .ear files? the steps to create an .ear file, the usage it is subjected to and the difference between .ear and .war files?
Thanks in advance.
[ May 21, 2002: Message edited by: Meena Samba ]
 
Liar, liar, pants on fire! refreshing plug:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic