S
stefan.machwirth
Hi everybody!
I have the following cheesy problem: I'd like to place a servlet as a
default root application within Tomcat6.
So I put the following ROOT.xml into "conf\Catalina\localhost":
<Context crossContext="true" docBase="D:\apache-
tomcat-6.0.14\startapp">
</Context>
So in "D:\apache-tomcat-6.0.14\startapp" is my application content,
including a WEB-INF, but some plain html-files, too. In the web.xml
there is following servlet mapping:
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
The idea is, that on a simple server request ("localhost:8080") this
servlet should answer the request as the root default application.
This works fine. But there are - as mentioned - these static GUI
files. The problem is, that all request-URLs to the other root
webcontent ("localhost:8080/gui.jsp", "localhost:8080/my.gif" or
others) are catched by this servlet-mapping, too :-(
The problem is, that this mapping "/" recognizes *ALL* requests. Is
there a way to configure a servlet-mapping which directs all requests
for the server name into the servlet, but serves other resources under
the root context like normal files?
Thanx a lot!
Stefan
I have the following cheesy problem: I'd like to place a servlet as a
default root application within Tomcat6.
So I put the following ROOT.xml into "conf\Catalina\localhost":
<Context crossContext="true" docBase="D:\apache-
tomcat-6.0.14\startapp">
</Context>
So in "D:\apache-tomcat-6.0.14\startapp" is my application content,
including a WEB-INF, but some plain html-files, too. In the web.xml
there is following servlet mapping:
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
The idea is, that on a simple server request ("localhost:8080") this
servlet should answer the request as the root default application.
This works fine. But there are - as mentioned - these static GUI
files. The problem is, that all request-URLs to the other root
webcontent ("localhost:8080/gui.jsp", "localhost:8080/my.gif" or
others) are catched by this servlet-mapping, too :-(
The problem is, that this mapping "/" recognizes *ALL* requests. Is
there a way to configure a servlet-mapping which directs all requests
for the server name into the servlet, but serves other resources under
the root context like normal files?
Thanx a lot!
Stefan