1.

Solve : help with TOMCAT server?

Answer»

hi ,
i m tryin to practise the HTTPServlets and so i installed Tomcat 5 and installed J2sdk1.4.1 and gave the correct path while installing Tomcat 5. My context root inside c:/tomcat/webapps is jhpt5 . and i made two subdirectories inside jhpt5 ,servlets and WEB-INF . I placed the .html in servlets . In WEB-INF i put web.xml with correct deployment descriptor.and placed another subdirectory classes inside WEB-INF.This is where i puit all java servlet programs tht has to b invoked through the .html . i m able to get the webpage while running server thru port 8080 but wen i try to instantiate the "get" request thru servlets,that is tryin to call the class i get the CLASS NOT FOUND exception in the webpage. precisely, the heirarchial view is(folders -bold ,FILES -italics)
webapps
jhtp5
servlets
WelcomeServlet2.html
WEB-INF
web.xml
classes
WelcomeServlet2.java
My web.xml is
PUBLIC "-//Sun Microsystems, Inc.//DTD Web APPLICATION 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">



Welcome Servlet2


Documentation.



welcome2


A simple servlet


WelcomeServlet2



welcome2
/welcome2


in WelcomeServlet2.html , i have put
i get a class not found ,also i restart the server after CHANGING web.xml each time.
Could anyone help me out with where i have gone wrong.
cheersFor the record folks, I know nothing about servlets, have virtually no Java programming experience and have never installed Tomcat. Any takers for this query?i found what my problem was. I had to compile the .java file and shud place the .class file in WEB-INF . I have not compiled the .java file earlier. But i have a problem there as well . I dont know how to get servlets compiled , because when i tried to compile with eclipse , it showed that import javax.servlets.* and javax.http.* could not be RECOGNISED . Is it something to do with library . Or is ther any other way to compile servlets . Some help on this topic would be very useful and informative . Thanks



Discussion

No Comment Found