aspose file tools*
The moose likes Servlets and the fly likes Servlet creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet creation" Watch "Servlet creation" New topic
Author

Servlet creation

John Campbell
Ranch Hand

Joined: Mar 11, 2005
Posts: 53
I'm quite new to servlets and have just started reading K&B's book on it. I was trying to create a servlet on my eclipse but it doesn't allow me to import the servlet package.

I have j2sdk1.5.0 installed on my machine. What else am I missing? please suggest.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can get either download j2ee from Sun's site or, if you are using Tomcat, put servlet-api.jar on your classpath. It's under TOMCAT_HOME/common/lib


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
John Campbell
Ranch Hand

Joined: Mar 11, 2005
Posts: 53
Cheers Ben - I'm using Tomcat and could find servlet-api.jar as well but since I was using eclipse I never had to set the classpath before!! I tried setting it just now but its not working :-(

this is how I created the classpath environment variable:

variable name: CLASSPATH
variable value: C:\Program Files\Java\j2sdk1.5.0\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api

Thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I think with Eclipse, you add it as an "external jar" (somewhere from the projects menu).
John Campbell
Ranch Hand

Joined: Mar 11, 2005
Posts: 53
got it!

cheers Ben
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet creation