Help needed with servlets.

Hi .. i am new to servlets and iam trying to write my first servlet using Eclipse environment.

the problem is when i try to add the package javax.servlet eclipse shows and error and the intellisense does not show me the .servlet package. do i have to install anything for this? its showing me some packages like .security and things like that..

Thanks in advance.

[382 byte] By [Bmista] at [2007-11-27 5:09:53]
# 1
You have to include your servlet.api jars in the classpath of your project. You can do it by adding external jars option.
AnanSmritia at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
From where can i download the servlet jar files? do i have to install J2EE for that same?if yes then can you pls send me the link from where i can install the same?Thanks for your help.
Bmista at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I dont know what server you are using. The following is applicable for tomcatIf you have already downloaded.browser tomcat home and open lib folder.there are many jars including servlet.api
AnanSmritia at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
well i am not using any server right now .. just trying to develop a small servlet on my desktop. is there any way to install a test server just to test the servlet ?Thanks for your help.
Bmista at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
lol :). Servlet container is required for running a servlet. Download tomcat and browse lib folder. You will find servlet.api jar. Include this jar in your classpath.write web.xml start server run your servlet
AnanSmritia at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
well i am a hardcore C++,VC++ programmer so i don't know all this :) hehe.. so can you pls list down steps .. first i need to download a Tomcat server correct ?Also then can i deploy the servlets on to this server itself ?Thanks.
Bmista at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Download Tomcatset CLASSPATHwrite web.xmland save this web.xml and your package/servlet file under WEB-INF under Webapps folder in tomcatthen start your tomcatrun your app using http://localhost:8080/testServlet
AnanSmritia at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
how to create servlet handler in java
abhinay_31a at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
ok thanks that is a very good info but my problem is ... the javax.servlet package is not detected during the development on my servlet so how do i resolve this ?Thanks for your help.
Bmista at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
It means your servlet.jar is not in the classpath. Set the classpath
AnanSmritia at 2007-7-12 10:29:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...