#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    21
    Rep Power
    0

    What is a war file?


    I have to create a war file to upload my application to our servers. Can someone tell me simply what it is and step by step how I create one?

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    361
    Rep Power
    13
    a war file is a "web archive" file and is used for deploying web applications. details on file structure and howto is here:

    http://java.sun.com/webservices/docs...pp3.html#75043

    basically it's everything that should be in your web app (WEB-INF, web.xml, classes, lib, jsps etc) bundled up into a single file which the application server can unwrap automatically.
    Little more than a playground for the bugs that live beneath us...
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    21
    Rep Power
    0
    Thanks for the link however I have a couple of questions before I can start.

    The document mentions using the JAR tool distributed with the J2SE SDK. I found a jar.exe file but when I run it it just opens a dos like window and closes it again. How do I use this?

    Another way it suggests is with the Ant war task (whats that?)
    "Both of these methods require you to have created a Web application deployment descriptor. " What is a web application deployment descriptor?

    "You can also package an application into a WAR using deploytool. "
    Deploytool?

    Thanks in advance...
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    361
    Rep Power
    13
    sorry, there was some superfluous stuff in that document - i don't know about ant and deploytool, except that you won't need them - what is important is the file structure with the WEB_INF folder and the classes folder etc. if you're using javabeans or taglibs then this structure will be essential - if you just have straight jsps then it's not so important.

    ther'e nothing magical really - think of it as a zip file that the app server can unbundle automatically. it's called war after the tar format (tape archive) familiar to *nix users.

    as for the jar.exe, run it from a command prompt.

    the web app deployment descriptor is the web.xml file which holds directives to configure such things as the default document for the app.

    have a look at this page:

    http://jakarta.apache.org/tomcat/tom...eployment.html

    it refers to tomcat4, but the file structure is defined in specifications (i don't remember which set of specs!) so something similar will apply for other app servers.

    hope this helps.
    Little more than a playground for the bugs that live beneath us...

IMN logo majestic logo threadwatch logo seochat tools logo