Root application in Tomcat6 and servlet-mapping

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top