Root application in Tomcat6 and servlet-mapping

Discussion in 'Java' started by stefan.machwirth@debeka.de, Oct 19, 2007.

  1. Guest

    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
    , Oct 19, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    1,996
    Jack Jia
    Apr 4, 2004
  2. F. H.
    Replies:
    2
    Views:
    1,167
    F. H.
    Aug 22, 2004
  3. MattC
    Replies:
    1
    Views:
    498
    Manish Pandit
    Feb 8, 2007
  4. ruds
    Replies:
    27
    Views:
    1,260
    Arne Vajhøj
    Dec 16, 2007
  5. Gerard H. Pille

    java GC options for tomcat6 service

    Gerard H. Pille, Apr 14, 2011, in forum: Java
    Replies:
    4
    Views:
    1,459
    Gerard H. Pille
    Apr 16, 2011
Loading...

Share This Page