You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kapil sharma <sh...@hotmail.com> on 2000/11/27 17:44:31 UTC

how to create war file

Dear List

I'm a beginner on Tomcat can any one tell me how to create war file and 
where to place it for a very simple "hello world" jsp program.

thanx
ks
_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


Re: how to create war file

Posted by Dan Smith <da...@globalone.net>.
Use the jar command (i.e. jar cvf myapp.war classes...).  The classes
should be located in a directory structure as follows:

    myapp
        |
        |-- HTML/JSP files
        |
        |--WEB-INF
                    |
                    |--web.xml
                    |
                    |--classes
                    |        |
                    |        |--all classes (or packages)
                    |
                    |--lib
                            |
                            |-- all 3rd party jars and zips (i.e. JDBC
drivers, XML Parsers...)

NOTE:  If you have your classes (i.e. beans) located under a package
(i.e. com.mycompany.mybeans), then the package structure needs to be
preserved under the 'WEB-INF/classes' directory.  In other words,
com.mycompany.mybeans.Bean1.class would be found under
WEB-INF/classes/com/mycompany/mybeans/Bean1.class.

Once you have your war file, we will call it 'myapp.war', you place it
under the Tomcat 'webapps' directory.  When you restart tomcat, it will
expand myapp.war into the directory 'myapp', adding the path
'myapp/WEB-INF/classes' to the classpath along with all jar and zip
files under 'myapp/WEB-INF/lib'.

For a complete discussion in WebApps, see the link under Apache at
http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/appdev/index.html

Hope this helps,
Dan



--
"Sometimes I wish I could be you, just so I could be friends with me."
                -- Agelica Pickles



Re: how to create war file

Posted by Carlos <li...@lpis.com>.
is necesari for a ap`plication o virtual domain to create a war file
----- Original Message -----
From: "Mike La Budde" <mi...@irista.com>
To: <to...@jakarta.apache.org>
Sent: Monday, November 27, 2000 5:58 PM
Subject: Re: how to create war file


> At 11/27/2000 04:44 PM +0000, you wrote:
> >Dear List
> >
> >I'm a beginner on Tomcat can any one tell me how to create war file and
> >where to place it for a very simple "hello world" jsp program.
>
> 1) You can use the jar command. E.g. Navigate to your classes directory
and
> use this command:
>
> jar cvf myapp.war .
>
> 2) You can simply use winzip (or equivalent) to create a zip file and
> rename it to have a war extension.
>
> 3) Use j2ee graphical method of creating a war file.
>
> 4) Check your ide, some will help you create one...
>
> 5) Use the new war task in Ant 1.2
>
> HTH,
>
> Mike
>
>
> >thanx
> >ks
>
>___________________________________________________________________________
__________
> >Get more from the Web.  FREE MSN Explorer download :
http://explorer.msn.com
>
>


Re: how to create war file

Posted by Mike La Budde <mi...@irista.com>.
At 11/27/2000 04:44 PM +0000, you wrote:
>Dear List
>
>I'm a beginner on Tomcat can any one tell me how to create war file and 
>where to place it for a very simple "hello world" jsp program.

1) You can use the jar command. E.g. Navigate to your classes directory and 
use this command:

jar cvf myapp.war .

2) You can simply use winzip (or equivalent) to create a zip file and 
rename it to have a war extension.

3) Use j2ee graphical method of creating a war file.

4) Check your ide, some will help you create one...

5) Use the new war task in Ant 1.2

HTH,

Mike


>thanx
>ks
>_____________________________________________________________________________________
>Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com