Description of problem: When mounted somewhere other than "/", the login UI prepends the context path twice, causing links to point to invalid locations. Version-Release number of selected component (if applicable): 5.3.0.AUTO.02.18.2003 How reproducible: Reproducible Steps to Reproduce: 1. Mount CCM at "/ccm" 2. Set context path to "/ccm", and servlet path to "" in enterprise.init 3. Load "<hostname>/ccm/" in a browser. The site should redirect to /ccm/register. 4. Click on any link on the page. Actual results: The selected link will be to "/ccm/ccm/wherever" Expected results: The link should point to "/ccm/wherever" Additional info: bebop.Link prepends the DispatcherPath to any absolute location (bebop/Link.java:251). The admin UI creates links with absolute paths to the site root, not the context root, by calling Initializer.getFullURL(), which prepends SiteNode.getRootSiteNode().getURL(req). (kernel/security/Initializer.java:303,313) Replacing getRootURL(req) in getFullURL() (kernel/security/Initializer.java:303) with "/" seems to solve the problem.
*** Bug 84711 has been marked as a duplicate of this bug. ***
What are your enterprise.init parameters for the dispatcher and web initializers? Also, what your servlet mappings in your web.xml? On first glance, this appears to be a config problem.
That's what I thought too, but tweaking dispatcher[Context|Servlet]Path didn't seem to help, and going through the code pointed to the solution mentioned (see the Additional Info above). bebop.Link.prepareURL(PageState,String) prepends the dispatcher path, kernel.security.Initializer.getRootURL(HttpServletRequest) called by kernel.security.Initializer.getFullURL(String,HttpServletRequest) calls SiteNode.getRootSiteNode().getURL(req). The latter method prepends the context path, as does web.URL().getDispatcherPath(). Perhaps the real problem is that these two (three?) methods of constructing URLs should be reconciled. init com.arsdigita.web.Initializer { defaultScheme = "http"; serverName = "localhost"; serverPort = 8080; hostName = "ccm.trailmagic.com"; dispatcherContextPath = "/ccm"; dispatcherServletPath = ""; } init com.arsdigita.dispatcher.Initializer { staticURLPrefix = "/STATIC/"; // Set to 'no' to disable all output of cache control headers cachingActive = "yes"; // Cache expiry time in seconds - eg. Three days. defaultExpiry = 259200; }
Assigning to Justin.
Hrm... I just have: <web-app id='ccm'/> in my resin.conf. I'm assuming I don't need anything fancy in there.