Thanks Andreas... at first I didn't want to use any web.xml entries as this was just a test directory to run the examples of the oreilly book. I just wanted to compile the examples and run them without messing with web.xml.
Nevertheless, I took your advice but I get the same server exceptions (cannot allocate servlet instance for path /jat/servlet/com.justatest.test.InitSnoop ... and ... cause NoClassDefFoundError: com/justatest/test/InitSnoop (wrong name: InitSnoop)) even when I run http://localhost:8080/jat/servlet/MyServletName after adding your entry into web.xml and restarting the server. It's looking like the problem lies somewhere else i.e. the url's I've been using are correct? thanks /j-p. On Fri, 20 Sep 2002, Andreas Mohrig wrote: > 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. > ----------------------- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
