Tomcat is not adding trailing slash to web app's context

后端 未结 5 1385
自闭症患者
自闭症患者 2020-12-09 10:10

I\'d like to have Tomcat automatically add a trailing slash to my app\'s context if the url is entered without it.

When I test with Jetty, it automatically adds the

5条回答
  •  囚心锁ツ
    2020-12-09 10:26

    It seems that your application's web.xml has a mapping to "/*". A servlet-mapping to "/*" causes tomcat to pass the request as-is to the web application (i.e. does not redirect).

    To properly redirect, you must change the "/*" mapping to just "/", the latter means the default servlet.

提交回复
热议问题