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

后端 未结 5 1466
自闭症患者
自闭症患者 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:31

    Tomcat adds a trailing slash automatically. Just test it with the example application supplied with Tomcat..

    If - due to some special configuration - it does not, I'd write a Filter that examines the query string and redirects as needed by the application. Many times this is needed anyways (doing http->https redirections, etc.)

提交回复
热议问题