2

I am using Tomcat as WTP in eclipse, and I want to route all Incoming requests to my own Servlet.

When just mapping the Servlet to "/", only requests like: "http://localhost:8080/myServletName/anyUrlPattern" are redirected,

but I want: "http://localhost:8080/anyUrlPattern" redirect too.

Tomcat maps the default-servlet to "/" so I guess something has to be done there..

As commented below, the solution is to set the Context in the server.xml

Quick n Dirty
  • 569
  • 2
  • 7
  • 15
  • Did you try to map your servlet to `/*`? – Uooo Mar 04 '13 at 13:20
  • 2
    possible duplicate or at least related to http://stackoverflow.com/questions/4044129/tomcat-making-a-project-folder-the-web-root and http://stackoverflow.com/questions/2437465/java-how-to-change-context-root-of-a-dynamic-web-project-in-eclipse – gabtub Mar 04 '13 at 14:23

1 Answers1

0

As far as I recall that is not possible and/or discuraged, because the <display-name> is used to distinguish between (possibly) multiple WebApps running on your tomcat.

sschrass
  • 7,014
  • 6
  • 43
  • 62