tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: war file question
Date Mon, 06 Dec 2010 19:55:25 GMT
2010/12/6 Lava Saleem <>:
> Hi
> Thanks for the replies
> Pid thanks for the link but I have looked into before sending the email and
> it is very general and not very useful, as I'm a beginner user for tomcat.
> Check I was deploying the  file with jsp extension  and I got this
> message on the top of the tomcat webpage. Now I have my html file in the
> WEB-INF  I changed the extension to war but that didn't work as it didn't
> work if I left it as html extension. it is very simple file with few lines
> of java script.
> Thanks

1. WAR is effectively a zip archive. You create one using the "jar"
archiver program in the JDK.

That is: you have to prepare the files for your web application and
then "zip" them with the jar utility.

E.g. for the examples webapp that comes with Tomcat:
1) go to
2) run
 jar -cf examples.war -C examples .

it will pack the "examples" directory into a war file.

2. The WEB-INF and META-INF subdirectories are special. They are not
"visible" from the outside. So, you should not put your .html, or .js,
or .css or images there.

The WEB-INF directory is for configuration (the web.xml file is the
main one there) and for executable code.

You should place your web page elsewhere. Usually - at the root of your webapp.

See the ROOT application that comes with Tomcat, You will find an
index.html there.

(ROOT is the special name for the default webapp on Tomcat).

3. There should be tutorials for beginners somewhere. (One is that Pid

You should really go step-by-step with a one of them once.

The links to the official specifications can be found here:

Best regards,
Konstantin Kolinko

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message