aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Help me out very simple basic problem in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Help me out very simple basic problem in servlets" Watch "Help me out very simple basic problem in servlets" New topic
Author

Help me out very simple basic problem in servlets

Matt Swaggi
Ranch Hand

Joined: May 29, 2008
Posts: 61
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

Joined: Aug 16, 2005
Posts: 13869
    
  10

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
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.


Be Humble... Be Nice.
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

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 ]

Never try to be a hard-worker. Be a smart-worker.
My Blog
Matt Swaggi
Ranch Hand

Joined: May 29, 2008
Posts: 61
Thank You . Its Working !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me out very simple basic problem in servlets
 
Similar Threads
HTTP Status 404 ERROR
Passed with 89%, solved the "quotes" mystery.
Problem running first servlet
how to cross over "javax.servlet.* not found " problem?
Where should I download javax.servlets package?