Affects Version/s: 1.0-beta-1
Fix Version/s: None
The project I am currently working must be the ROOT application in tomcat. Therefore 'path' is set to '/'.
It also uses the server side redirects internally through tuckey's URLRewriteFilter, but this bug should be valid for any stack that uses serverside redirects that is based on Tomcat internal (re)dispatcher.
Bug occurs as a serverside redirect ie: '/myOriginalPath' is redispatched to '/myDestinedPath' ends up as '//myDestinedPath' which has the illegal '/' in the beginning which breaks our application and supposedly an illegal url as well.
In case this configuration used Maven Tomcat Plugin passes '/' as the context path which conflicts with createContext(String path, String docBase) which specifically says "Context path of this application ("" for the default application for this host, must start with a slash otherwise) @param docBase Absolute pathname to the document base directory for this web application"
It is impossible to set the context path to "" in the pom as this then yields to maven setting it to default which is "/"
If the context path is set to "/" then it is passed as it is which is illegal according to the Tomcat Docs.
The attached patch resolves the issue by simple passing "" in case of "/" is set as the path.
No documentation or pom interface change therefore change is transparent and does not break.