Description of problem: Consider a URL /apps/plaintext/ccm/portal/homepage.jsp The /apps/ bit is the context prefix, the /plaintext/ bit is the dispatcher prefix and the /ccm/ bit is the servlet prefix. Unfortunately the c.a.web.URL class chops the components out in the order context, servlet, dispatcher prefixes. So when it re-consistutes the URL you get /apps/ccm/plaintext/portal/homepage.jsp which obviously doesn't dispatch to anything. This bug looks like it was always there, but we didn't encounter it previously because we always mounted apps on / instead of /ccm. In addition the PageTransformer class is adding the dispatcher prefix onto the end of the context-prefix variable, so it ends up duplicated thus: /ccm/text/text Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Add in an instance of the InternalPrefixerServlet to web.xml 2. Visit the homepage using the prefix defined in web.xml 3. Look at the XML source to view the any URLs in the page Actual results: URLs are starting with /ccm/text/pvt Expected results: URLs are starting with /text/ccm/pvt Additional info: The patch is: ==== //core-platform/dev/src/com/arsdigita/bebop/page/PageTransformer.java#5 - /var/ccm-devel/dev/dan/aplaws-rickshaw/core/src/com/arsdigita/bebop/page/PageTransformer.java ==== 245,247c245 < com.arsdigita.web.URL.getDispatcherPath() + < (DispatcherHelper.getDispatcherPrefix(req) == null ? "" : < DispatcherHelper.getDispatcherPrefix(req))); --- > com.arsdigita.web.URL.getDispatcherPath()); ==== //core-platform/dev/src/com/arsdigita/web/URL.java#29 - /var/ccm-devel/dev/dan/aplaws-rickshaw/core/src/com/arsdigita/web/URL.java ==== 229,231d228 < m_url.append(servletPath); < m_servletPathEnd = m_url.length(); < 236a234,236 > m_url.append(servletPath); > m_servletPathEnd = m_url.length(); > 457a458,466 > * <p>Experimental</p> > * <p>Returns the dispatcher prefix of this request as > * set by the InternalPrefixerServlet > */ > public final String getDispatcherPrefix() { > return m_url.substring(m_contextPathEnd, m_dispatcherPrefixEnd); > } > > /** 465c474 < return m_url.substring(m_contextPathEnd, m_servletPathEnd); --- > return m_url.substring(m_dispatcherPrefixEnd, m_servletPathEnd); 469,477d477 < * <p>Experimental</p> < * <p>Returns the dispatcher prefix of this request as < * set by the InternalPrefixerServlet < */ < public final String getDispatcherPrefix() { < return m_url.substring(m_servletPathEnd, m_dispatcherPrefixEnd); < } < < /** 488c488 < final String pathInfo = m_url.substring(m_dispatcherPrefixEnd); --- > final String pathInfo = m_url.substring(m_servletPathEnd); 885c885 < return context + servlet + prefix; --- > return context + prefix + servlet;
btw, can you do diff -uw next time? i personally hate regular ol' diffs...
Created attachment 95971 [details] Diff for fix
The above fix was applied in perforce change 38216.