I'm trying to use the alias-url-regexp attribute introduced in Resin
4.0.22 to have multiple context paths to the same web app:
<web-app id="/foo" alias-url-regexp="/foo-[^/]*"
When navigating to a page within the application (e.g.
/foo-bar/welcome/user.html), the page is rendered correctly, but all the
links within the page (generated by spring:url jsp tags) point to
/foo/xyz instead of /foo-bar/xyz, so the context path is not maintained.
However, in a servlet filter, request.getContextPath() does correctly
return the actual context path used (e.g. /foo-bar), so I ended up
wrapping the request and overriding getContextPath() to always return
the "initial" value. Urls generated by the spring:url jsp tags then
point to the correct context path, but this approach feels like a hack,
and some redirects still cause a return to /foo/xyz instead of /foo-bar/xyz.
Both with and without this filter in place, I'm experiencing strange
behavior resolving the welcome page, where navigating to /foo-bar works,
but /foo-bar/ results in a 404, while both /foo and /foo/ work correctly.
I've tested with both 4.0.38 and 4.0.22 (where the feature was
introduced), and their behavior appears to be identical.
My goal is to encode the locale/language in the context path (e.g.
/foo/en, /foo/nl, /foo/fr, ...), and alias-url-regexp seems perfect for
that, but maybe I'm not using it correctly?
resin-interest mailing list