File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Configuring Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Configuring Tomcat" Watch "Configuring Tomcat" New topic

Configuring Tomcat

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622

I am in process of developing a site. And i have to upload it, or rather host it. So, what all things i need to configure in tomcat? My application consist of servlets, and jsp.
I have also used connection pooling.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

You have to provide 2 objects. A WAR and a deployment descriptor.

By definition, all J2EE webapps must be in WAR format, although Tomcat does support "exploded" WARs, which are what you get when you unzip a WAR file.

There are actually 2 deployment descriptors. One is server-independent. It's the much-beloved WEB-INF/web.xml file in the WAR. The other is the server-dependent deployment descriptor, which is where the non-portable stuff lives that relates to the particular brand of server you're using (Tomcat, since you're in the Tomcat forum).

The server-dependent deployment descriptor is the Context. You can embed a Context in the Tomcat server.xm file, although this is strongly discouraged. More commonly, you'd create a file with the same name as your intended URL context path and and ".xml" file extension and place that in the Tomcat/conf/Catalina/localhost directory.

You can also add a META-INF/context.xml file in the WAR itself, which is convenient for holding a default Context. Using that means that you'd then only have to deploy the WAR itself, and not both the WAR and an independent context.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Configuring Tomcat
It's not a secret anymore!