lein-ring icon indicating copy to clipboard operation
lein-ring copied to clipboard

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

Open pallix opened this issue 11 years ago • 0 comments

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?

pallix avatar Nov 13 '14 15:11 pallix