java servlet compilation

How do I compile java servlet and in which directory?
[60 byte] By [Kramesha] at [2007-10-2 15:19:33]
# 1

A Servlet is like any other class. The fundamental classes regarding servlets are in the servlet.jar.If you are working with eclipse o Jcreator you need to add this jar to your proyect and import whichever classes you need for your Sevlet on the Servlet磗 code. To execute the servlet you will need a Web Server like Tomcat.

ingdouglasa at 2007-7-13 14:26:42 > top of Java-index,Developer Tools,Java Compiler...
# 2

To compile servlet class you need to provide the classes you used in your servlet class like( ServletRequest or HttpServletRequest or others) to the compiler by CLASSPATH variable. This can be done by setting the CLASSPATH to servlet-api.jar or servlet.jar ( You can get one in tomcat's lib folder). Now u can able to compile the servlet class. If u want to run then u need to use any java enabled web or application servers like weblogic, Tomcat,JBoss or others.

Naveen_Yalavarthia at 2007-7-13 14:26:42 > top of Java-index,Developer Tools,Java Compiler...
# 3
all replys are true... but to make life simple just use Netbeans it has built in tomcat server ...but u need to add servlet jar to the classpath..servlet's API available in j2EE only.wish u the best of luck brother
Alshehhia at 2007-7-13 14:26:42 > top of Java-index,Developer Tools,Java Compiler...
# 4

> all replys are true... but to make life simple just

> use Netbeans it has built in tomcat server ...but u

> need to add servlet jar to the classpath..

If you are using Netbeans, NO. In Netbeans, if you have configured your application as a web application, the servlet jar is included in the build classpath.

aniseeda at 2007-7-13 14:26:42 > top of Java-index,Developer Tools,Java Compiler...
# 5

> > all replys are true... but to make life simple

> just

> > use Netbeans it has built in tomcat server ...but

> u

> > need to add servlet jar to the classpath..

>

> If you are using Netbeans, NO. In Netbeans, if you

> have configured your application as a web

> application, the servlet jar is included in the build

> classpath.

You still need to have it included...

It's just that if you use an IDE with that capabillity and configure it correctly it will include it for you ;)

jwentinga at 2007-7-13 14:26:42 > top of Java-index,Developer Tools,Java Compiler...