Bug 84710 - Login UI prepends context path twice when mounted somewhere other than "/"
Login UI prepends context path twice when mounted somewhere other than "/"
Status: ASSIGNED
Product: Red Hat Web Application Framework
Classification: Retired
Component: ui (Show other bugs)
nightly
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
:
: 84711 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-20 15:39 EST by Oliver Stewart
Modified: 2009-12-14 19:01 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Oliver Stewart 2003-02-20 15:39:09 EST
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.
Comment 1 Oliver Stewart 2003-02-20 15:43:48 EST
*** Bug 84711 has been marked as a duplicate of this bug. ***
Comment 2 Richard Li 2003-02-20 16:11:32 EST
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.
Comment 3 Oliver Stewart 2003-02-20 16:32:28 EST
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;
}
Comment 4 Richard Li 2003-02-20 16:34:51 EST
Assigning to Justin.
Comment 5 Oliver Stewart 2003-02-21 00:49:39 EST
Hrm... I just have:
    <web-app id='ccm'/>

in my resin.conf.  I'm assuming I don't need anything fancy in there.

Note You need to log in before you can comment on or make changes to this bug.