I just experimented with this a bit. It seems tomcat provides standard mappings for the servlets you deploy under the document base of your webapp. A servlet residing in
<tomcat-root>/webapps/jat/classes/com/justatest/test/MyServlet.class should be reachable under http://yourserver/jat/servlet/com.justatest.test.MyServlet , at lest if you put it in the right package ("package com.justatest.test;", see the other answer below). If you define your servlet in your web.xml (which - in my humble opinion - you should always do), you get some more URLs for your servlet. The following will give you http://yourserver/jat/servlet/MyServletName and http://yourserver/jat/MyServletURL <servlet> <servlet-name>MyServletName</servlet-name> <servlet-class>com.justatest.test.MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>MyServletName</servlet-name> <url-pattern>/MyServletURL</url-pattern> </servlet-mapping> Try it and tell us if it works for you too. greetings Andreas Mohrig -----Original Message----- From: John-Paul Delaney [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 9:43 PM To: Tomcat Users List Subject: RE: Dumb Question com.justatest.test.MyServlet error Hello... Sorry about pushing so - but I'm stuck with this one.... What URL do I use to launch the servlet MyServlet deployed (not a .war) as: <tomcat-root>/webapps/jat/classes/com/justatest/test/MyServlet.class? (<tomcat-root>/webapps/jat/classes/MyServlet.class launches successfully with this url: http://localhost:8080/jat/servlet/MyServlet) I'm running tomcat 4.0.1 with sun jdk 1.3.1 on redhat 7.0. thanks for any help, /j-p. Quoting Miguel Angel Mulero Martinez <[EMAIL PROTECTED]>: > Maybe the InitSnoop.java don't start with "package com.justatest.test;" > > > -----Mensaje original----- > De: John-Paul Delaney [mailto:[EMAIL PROTECTED]] > Enviado el: viernes, 20 de septiembre de 2002 12:43 > Para: [EMAIL PROTECTED] > Asunto: Dumb Question ../servlet/com.justatest.test.MyServlet error > > Hello List... > > I've created the directory path: > <tomcat-root>webapps/jat/WEB-INF/classes/com/justatest/test/ > > but I get an error when I try to run the oreilly servlet from URL: > http://localhost:8080/jat/servlet/com.justatest.test.InitSnoop > > > The same servlet will run ok from URL: > http://localhost:8080/jat/servlet/InitSnoop > > The exception is: > Cannot allocate servlet instance for > path /jat/servlet/com.justatest.test.InitSnoop > > cause: > lang.NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: > InitSnoop) > > Any suggestions on what I'm doing wrong would be appreciated, > > thanks > /j-p. > -------------------- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
