Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      1,044

      Description

      I am not exactly sure if this is a glassfish JSP bug or not...
      But if the org.apache.catalina.jsp_file attribute is used to force the
      JSP servlet to handle a request with a specific resource, this attribute is
      not cleared (or hidden) when the JSP does a forward or include.

      This results in the attribute being used again and thus and include infinitely
      recurses on the same JSP.

      When using glassfish JSP in Jetty, I have fixed this by removing the
      attribute when a dispatch occurs - but I think it would be better for
      the JSP servlet to do this.

        Activity

        Hide
        gregwilkins added a comment -

        Created an attachment (id=405)
        A webapp that demonstrates the problem - hit /stack/lala

        Show
        gregwilkins added a comment - Created an attachment (id=405) A webapp that demonstrates the problem - hit /stack/lala
        Hide
        jluehe added a comment -

        Hi Greg,

        I'm unable to reproduce the infinite loop in GlassFish, because our container
        also (just like Jetty!) clears, if required, the org.apache.catalina.jsp_file
        request attribute before invoking the resource that is the target of the
        dispatch, as follows:

        String jspFile = wrapper.getJspFile();
        if (jspFile != null)
        request.setAttribute(Globals.JSP_FILE_ATTR, jspFile);
        else
        request.removeAttribute(Globals.JSP_FILE_ATTR);

        I think it is reasonable to expect that the container do this.

        Show
        jluehe added a comment - Hi Greg, I'm unable to reproduce the infinite loop in GlassFish, because our container also (just like Jetty!) clears, if required, the org.apache.catalina.jsp_file request attribute before invoking the resource that is the target of the dispatch, as follows: String jspFile = wrapper.getJspFile(); if (jspFile != null) request.setAttribute(Globals.JSP_FILE_ATTR, jspFile); else request.removeAttribute(Globals.JSP_FILE_ATTR); I think it is reasonable to expect that the container do this.
        Hide
        jluehe added a comment -

        Have JspServlet remove the "org.apache.catalina.jsp_file" request
        attribute after consuming it, so it does not need to be removed in
        several places in the web container.

        Notice that GlassFish did not go into an infinite loop (since the container
        has taken care of removing the attribute, if needed, prior to dispatching
        a request), which is why I've changed the issue's type from DEFECT
        to ENHANCEMENT.

        Checking in
        appserv-webtier/src/java/org/apache/catalina/core/ApplicationDispatcher.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ApplicationDispatcher.java,v
        <-- ApplicationDispatcher.java
        new revision: 1.11; previous revision: 1.10
        done
        Checking in
        appserv-webtier/src/java/org/apache/catalina/core/StandardWrapperValve.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardWrapperValve.java,v
        <-- StandardWrapperValve.java
        new revision: 1.8; previous revision: 1.7
        done
        Checking in appserv-webtier/src/java/org/apache/jasper/servlet/JspServlet.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/jasper/servlet/JspServlet.java,v
        <-- JspServlet.java
        new revision: 1.13; previous revision: 1.12
        done

        Show
        jluehe added a comment - Have JspServlet remove the "org.apache.catalina.jsp_file" request attribute after consuming it, so it does not need to be removed in several places in the web container. Notice that GlassFish did not go into an infinite loop (since the container has taken care of removing the attribute, if needed, prior to dispatching a request), which is why I've changed the issue's type from DEFECT to ENHANCEMENT. Checking in appserv-webtier/src/java/org/apache/catalina/core/ApplicationDispatcher.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/ApplicationDispatcher.java,v <-- ApplicationDispatcher.java new revision: 1.11; previous revision: 1.10 done Checking in appserv-webtier/src/java/org/apache/catalina/core/StandardWrapperValve.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardWrapperValve.java,v <-- StandardWrapperValve.java new revision: 1.8; previous revision: 1.7 done Checking in appserv-webtier/src/java/org/apache/jasper/servlet/JspServlet.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/jasper/servlet/JspServlet.java,v <-- JspServlet.java new revision: 1.13; previous revision: 1.12 done

          People

          • Assignee:
            jluehe
            Reporter:
            gregwilkins
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: