Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-282

railo ignores RequestDispatcher's include path, preferring to generate its own

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Labels:
      None
    • Environment:

      tomcat, magnolia 4.1

      Description

      Using railo with magnolia, we are attempting to use railo to render the templates and paragraphs. Templates are referred to a standard servlet, which renders OK with railo.
      Inside that page we bring in a magnolia jsp tag library, and call out to <includeTemplate, which boils down to a requestDispatcher include against a .cfm.
      Railo incorrectly interprets the include as an include for the top level page (what is in the url) instead of the path that was handed to requestDispatcher.

      Scenario:

      The url in the browser is /testcold.html, which is configured in magnolia to use a template, which forwards by extension to railo.
      Assume template is "/templates/sample-onecolumn.cfm" (renders ok!)
      Assume paragraph's path is "/templates/cf.cfm"
      Rendering a request, java code from magnolia's info.magnolia.context.WebContextImpl.include(String path, Writer out) (simplified):

      request.getRequestDispatcher(path).include(request, response);

      produces this output:

      Fri Jun 19 13:57:21 PDT 2009-97 Call:/templates/sample-onecolumn.cfm (1)
      Fri Jun 19 13:57:21 PDT 2009-206 Call:/testcold.html (2)
      Page /testcold.html [C:\temp\magnolia-project\magnolia-empty-webapp\src\main\webapp\testcold.html] not found
      at railo.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:111):111
      at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:604):604
      at railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:35):35
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:24):24
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1651):1651
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:248):248
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803):803
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290):290
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654):654
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557):557
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481):481
      at info.magnolia.context.WebContextImpl.include(WebContextImpl.java:177):177
      at info.magnolia.module.templating.paragraphs.JspParagraphRenderer.onRender(JspParagraphRenderer.java:75):75
      at info.magnolia.module.templating.AbstractRenderer.render(AbstractRenderer.java:83):83
      at info.magnolia.module.templating.paragraphs.AbstractParagraphRenderer.render(AbstractParagraphRenderer.java:64):64
      at info.magnolia.module.templating.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:111):111
      at info.magnolia.module.templating.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:89):89
      at info.magnolia.cms.taglibs.Include.doEndTag(Include.java:202):202
      at templates.sample_onecolumn_cfm315$cf.call(C:\temp\magnolia-project\magnolia-empty-webapp\src\main\webapp\templates\sample-onecolumn.cfm:26):26
      at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:609):609
      at railo.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:35):35
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:24):24
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1651):1651
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:248):248
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803):803
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290):290
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
      at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:99):99
      .... (more, but irrelevant, all the way down magnolia's filter chain, through tomcat's j2ee stuff to Thread)
      Fri Jun 19 13:57:21 PDT 2009-253 Release: (2)
      Fri Jun 19 13:57:21 PDT 2009-269 Release: (1)

      As you can see the second railo include, the paragraph which is nested outputs this:
      Fri Jun 19 13:57:21 PDT 2009-206 Call:/testcold.html (2)
      This is wrong, the include call from the RequestDispatcher path is not /testcold.html, it is /templates/cf.cfm

      If I change the line from using an include for the paragraph, into another forward, railo outputs what is expected, and appears to work. However this feels like an unreasonable hack against magnolia:

      Modified to: request.getRequestDispatcher(path).forward(request, response);

      Fri Jun 19 14:10:00 PDT 2009-669 Call:/templates/sample-onecolumn.cfm (1)
      Fri Jun 19 14:10:00 PDT 2009-919 Call:/templates/cf.cfm (2)
      Fri Jun 19 14:10:00 PDT 2009-950 Release: (2)
      Fri Jun 19 14:10:00 PDT 2009-966 Release: (1)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                frankamp Joshua Frankamp
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: