File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes where to place servlet class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "where to place servlet class file " Watch "where to place servlet class file " New topic

where to place servlet class file

niku shah
Ranch Hand

Joined: Aug 28, 2006
Posts: 43

I have installed Tomcat 5.0.28 version.
i want to know that inwhich directory servlet class files should be placed.

i am using JDK1.5 and JSDK2.0 for servlet.

also servletrunner in JSDK2.0 runs on port 8080 which is used by Tomcat so they both are conflicting, how can i change the default port for servletrunner ?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

If you have Tomcat, why do you need servletrunner?

[Asking smart questions] [About Bear] [Books by Bear]
niku shah
Ranch Hand

Joined: Aug 28, 2006
Posts: 43
Hi Bear Bibeault

actually i am new in using Tomcat , if i dont use servletrunner then how will i compile my sevlets ?

Is there any other way to compile servlets , or is there any path setting in tomcat that will compile servlet classes with JDK1.5 ?


William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Personally I compile servlets like I do all Java - using an ANT build script.
However you compile, your classpath will need to include servlet-api.jar which Tomcat keeps in $TOMCAT_HOME\common\lib
I don't know about servletrunner, but Tomcat uses a port defined in the ..\conf\server.xml file. Look for the <Connector element.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

At a bare minumum, all Java developers should be able to compile a simple class with javac.

If you don't know how to do this, there are plenty of Java tutorials that cover setting up a classpath and compiling.

Once you're comfortable with doing this, you may want to look for a tool or IDE to speed up your development process but I wouldn't rely on one until I knew I could get by in a pinch without it.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: where to place servlet class file
It's not a secret anymore!