Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 84710 - Login UI prepends context path twice when mounted somewhere other than "/"
Summary: Login UI prepends context path twice when mounted somewhere other than "/"
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: ui
Version: nightly
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
: 84711 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2003-02-20 20:39 UTC by Oliver Stewart
Modified: 2009-12-15 00:01 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Oliver Stewart 2003-02-20 20:39:09 UTC
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):

How 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/  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/,313)  Replacing getRootURL(req) in
getFullURL() (kernel/security/ with "/" seems to solve the

Comment 1 Oliver Stewart 2003-02-20 20:43:48 UTC
*** Bug 84711 has been marked as a duplicate of this bug. ***

Comment 2 Richard Li 2003-02-20 21:11:32 UTC
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 21:32:28 UTC
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,
called by,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 = "";
    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 21:34:51 UTC
Assigning to Justin.

Comment 5 Oliver Stewart 2003-02-21 05:49:39 UTC
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.