web.xml problem

Hi,

I have a class myexample.class in the following directory:

/webapps/temp/example/WEB-INF/classes

and my webapps/temp/example/WEB-INF/web.xml is as following:

<servlet>

<servlet-name>myexample</servlet-name>

<servlet-class>myexample</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>myexample</servlet-name>

<url-pattern>/myexample</url-pattern>

</servlet-mapping>

I got an error "The requested resource (/temp/example/myexample) is not available." but if I put "example" directory directly under webapps (I mean webapps/example instead of webapps/temp/example), there's no errors. Does anyone know how to deal with this problem? Thank you!

Karen

[816 byte] By [karenJJa] at [2007-11-27 9:02:57]
# 1

The web server looks for directories under the webapps directory that contain a sub directory named WEB-INF to dynamically find and load any web applications. When you do webapps/temp/example the server thinks that you are trying to deploy a web application named temp but when it doesn't find a WEB-INF directory directly under temp it stops looking. It only looks one directory layer down.

http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html

tolmanka at 2007-7-12 21:34:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you for your reply. So there's no any other way to make it possible have more than one sub directory? Karen
karenJJa at 2007-7-12 21:34:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
> Thank you for your reply. > > So there's no any other way to make it possible have> more than one sub directory? Why do your need more? What problem are you trying to solve?
RaymondDeCampoa at 2007-7-12 21:34:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
because I want to structure related applications togetherfor example:/temp/example1/temp/example2......
karenJJa at 2007-7-12 21:34:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...