It's not a secret anymore!
The moose likes Tomcat and the fly likes how to a war file in TOMCAT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to a war file in TOMCAT" Watch "how to a war file in TOMCAT" New topic

how to a war file in TOMCAT

santosh akella
Ranch Hand

Joined: Oct 24, 2004
Posts: 32
basically i am new to tomcat.... , and i am learning JSP.
so, could any one tell me how to run a JSP file which is calling a servlet class file ...
and i got some advice that we should make a war file and keep it in web-apps
folder.. and then call that file in the URL like http://localhost:8080/filename but its not working..
pls guide me ...
thank u in advance
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Its not a compulsion that you need to create a war for running the servlets and jsps on Tomcat. you can just put the class files as they are and can get them running .
First you need to create your servlets then had to update the WEB-INF/web.xml with the servlet entries.
In this WEB-INF folder only create a 'lib and classes inside lib' folder and add your classes to it.
You should be able to access them.No need to go for war file,you can use war file , once you gain some expertise

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you want some examples you can find some simple ones here:

There is a good tutorial on the Tomcat site:

It should help you get started.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: how to a war file in TOMCAT
jQuery in Action, 3rd edition