Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set the classpath for servlet and jsp???

843841Oct 27 2007 — edited Nov 19 2007
i add C:\tomcat-5.0\common\lib\servlet-api+jsp-api to the class path from DOS prompt, as show below:

set CLASSPATH=%classpath%;C:\tomcat-5.0\common\lib\servlet-api.jar;C:\tomcat-5.0\common\lib\jsp-api.jar

then, i compile the servlet:

javac FirstServlet.java

no error

and i copy the .class file into C:\tomcat-5.0\webapps\servlets-examples\WEB-INF\classes

i set the JAVA_HOME enviroment variable as below:

set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_08

i start the tomcat version 5.0 and run web browser and type http://localhost:8080/servlets-examples/servlet/FirstServlet

i get the error message:

HTTP Status 404 - /servlets-examples/servlet/FirstServlet

type Status report

message /servlets-examples/servlet/FirstServlet

description The requested resource (/servlets-examples/servlet/FirstServlet) is not available.
Apache Tomcat/5.0.30

Can anybody tell me how to solve the problem. Thanks a lot.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2007
Added on Oct 27 2007
4 comments
527 views