Thanks

a lot of things start to make sense now

Dom

-----Original Message-----
From: Randy Layman [mailto:[EMAIL PROTECTED]]
Sent: 24 January 2002 11:59
To: 'Tomcat Users List'
Subject: RE: specifying servlet in subdirectory in web.xml



        The directories under the classes directory correspond to the
package statement used in the source file.  If you want to call your class
hello.HelloWorldExample then you need to put "package hello;" as the first
line of HelloWorldExample.java and recompile.

        Randy
 

> -----Original Message-----
> From: Cressatti, Dominique [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 24, 2002 7:40 AM
> To: Tomcat Users List
> Subject: specifying servlet in subdirectory in web.xml
> 
> 
> Hi,
>  
> how do I specify the location of class in a subdirectory.
>  
> I have HelloWorldExample.class and LocalStrings.properties under
> /webapps/test/WEB-INF/classes
> and my web.xml looks like:
> ...
> <servlet>
>     <servlet-name>hello</servlet-name>
>     <servlet-class>HelloWorldExample</servlet-class>
> </servlet>
>  
> <servlet-mapping>
>     <servlet-name>hello</servlet-name>
>     <url-pattern>/hello</url-pattern>
> </servlet-mapping>
> ...
>  
> It all works find I point my browser to 
> http://localhost:8080/test/hello.
> However if I move HelloWorldExample.class and 
> LocalStrings.properties under
> /webapps/test/WEB-INF/classes/hello
> and change my web.xml (to reflect the move) to:
> ... 
> <servlet>
>     <servlet-name>hello</servlet-name>
>     <servlet-class>hello.HelloWorldExample</servlet-class>
> </servlet>
> ...
> 
> pointing my browser to http://localhost:8080/test/hello
> comes up with:
> error 500
> location/test/hello
> internal error
> java.lang.NoClassDefFoundError: hello/HelloWorldExample 
> (wrong name: HelloWorldExample)
> ....
> why? I suspect that didn't define the path in <servlet-class> 
> correctly so what's the right syntax?
>  
> Thanks
> Dom
> 
> 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to