weavejester / lein-ring

Ring plugin for Leiningen
Eclipse Public License 1.0
501 stars 100 forks source link

url-pattern specified in the web.xml causes redirections to fail #139

Open pallix opened 10 years ago

pallix commented 10 years ago

The default generated web.xml file specify the following url-pattern in the servlet-mapping section:

    <url-pattern>/*</url-pattern>

According to this page: http://grokbase.com/p/tomcat/users/04cfv9wy5g/tomcat-redirecting-when-base-uri-doesnt-have-trailing-slash and one answer on this StackOverflow page: https://stackoverflow.com/questions/11055608/tomcat-is-not-adding-trailing-slash-to-web-apps-context

this cause Tomcat to not redirect URL that don't end with a trailing slash.

I edited the WAR to replace web.xml and the url-pattern by:

    <url-pattern>/</url-pattern>

which cause Tomcat to redirect correctly.

Are there any reasons to have /* instead of /. If not, can we fix this?