1

I created a Java web application and deployed the WAR (myapp.war) to Tomcat. When I hit the URL:

http://server.com/myapp

Tomcat redirects the browser to:

http://server.com/myapp/

How do I stop that? I don't want it to add the slash. I want my servlet to handle the request at /myapp.

My servlet mapping in web.xml looks like:

<servlet-mapping>
    <servlet-name>PageServlet</servlet-name>
    <url-pattern></url-pattern>  
    <url-pattern>/other</url-pattern>
    ...

I thought the empty pattern would get the root URL (/myapp) and let me handle it myself.

Rob N
  • 15,024
  • 17
  • 92
  • 165

0 Answers0