i am using Tomcat 4.1 i am able to run HTML and JSP from browser. But i am unable to run the servlet........ i kept the HelloServlet.class in the Tomcat\webapps\ROOT\WEB-INF\classes. and http://localhost:8080/servlet/HelloServlet is not working.Actually there was no classes directory in WEB-INF i created it and kept the class file in it. is that it wont work with higher versions of Tomcat ? then what i have to do......
once again thank u for ur response.Both the things didnot work.... 1)i made the web.xml as follows in WEB-INF directory <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> -<web-app> <display-name>Welcome to Tomcat</display-name> <description> Welcome to Tomcat </description> - <servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>HelloServlet</servlet-class> </servlet> - <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/servlet/HelloServlet</url-pattern> </servlet-mapping> </web-app> but still my servlet is not working . 2) i removed the comments for the invoker servlet in tomcat's web.xml under conf directory but still it ia not working 3) and the link u gave is very complex to understand .please help me in solving the problem
take those '-' out of your web.xml file. IE will add little plus and minus signs to XML files when it displays in a browser. If you copy and paste directly, you get the - and + symbols. It's not good to have them. [ March 03, 2003: Message edited by: Mike Curwen ]
posted 17 years ago
i am sorry Mike even after removing the '-'s from web.xml i am getting the 404 error. not able to get the page . please help..........
hi, i had encountered same problem with 4.1 vers. then i changed location from the one to <HOME>/ webapps/examples/WEB-INF/classes for testing purpose & it worked fine. then u need to configure server.xml,web.xml to make ur own pckgs. dont forget to change context path.type in brw. http://www.xxx.:<port pt>/examples/servlet/urfile.class
raghu tv, Take another look at the aforementioned thread. I just posted the exact steps I used to resolve this issue on my installation of Tomcat 4.1. Oh, and... Welcome to JavaRanch, raghu tv! We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy. Thanks Pardner! Hope to see you 'round the Ranch!