Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me out very simple basic problem in servlets

 
Matt Swaggi
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hay i am having eclipse platform version 3.3.0
i am beginner in java, just started servlets
But the problem is i cant import javax.servlets.*;
i cant find javax.servlets on my eclipse , do i have to install more
for servlets, please help me out !
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet API is not part of Java SE. You need to add a JAR file to the classpath. See Compiling Servlets in the JavaRanch FAQ.

In Eclipse, you add a JAR to your project by right-clicking on the project, selecting Properties, then go to Java Build Path, Libraries. Click Add External JARs; lookup the JAR with the servlet API and add it.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Just in case you are wondering what jar file to include, Download JSWDK(Java Sever Web Development Kit) from Sun's website and you will find servlet.jar in it.

Thanks.
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Copy servlet-api.jar or servlet.jar and paste it to the $TOMCAT/lib/ folder and then try to compile the servlet file..
[ July 10, 2008: Message edited by: Rajkumar balakrishnan ]
 
Matt Swaggi
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You . Its Working !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic