Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-74114 Make Liferay compatible with version 2.0 tests in the Portlet 3.0 TCK
  3. LPS-76231

Portlet 3.0 TCK: In a servlet forwarded to by the target of an include, the servlet request attribute javax.servlet.forward.* should be equal to return values of their corresponding method invoked the first servlet in the forward chain.

    Details

    • Type: Technical Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Test Failures:

      There are 20 test cases failing because of this:

      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletAction_attributes1a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletAction_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletAction_attributes3a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletAction_attributes4a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletAction_attributes5a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_attributes1a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_attributes3a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_attributes4a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_attributes5a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletRender_attributes1a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletRender_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletRender_attributes3a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletRender_attributes4a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletRender_attributes5a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_attributes1a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_attributes2a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_attributes3a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_attributes4a
      • V2DispatcherTests5_SPEC2_19_IncThenForwardServletResource_attributes5a

      The test cases fail with messages like

      Details: In a servlet forwarded to by the target of an include, the servlet request attribute javax.servlet.forward.request_uri will be set, and equals the value from HTTPServletRequest.getRequestURI for the first servlet in the forward chain. Error: /o/tck-V2DispatcherTests5/DispatcherTests5_SPEC2_19_IncThenForwardServletAction/invoke does not equal /o/tck-V2DispatcherTests5/IncluderForwarderServlet.

      Background:

      According to PLT 25.5.1 and PLT 25.6.1, when dispatching,

      Forward

      A servlet that has been invoked by a portlet using the forward method of RequestDispatcher has access to the path used to obtain the PortletRequestDispatcher. The following request attributes must be set:

      javax.servlet.forward.request_uri; javax.servlet.forward.context_path; javax.servlet.forward.servlet_path; javax.servlet.forward.path_info; javax.servlet.forward.query_string;

      The values of these attributes must be equal to the return values of the HttpServletRequest methods getRequestURIgetContextPathgetServletPathgetPathInfogetQueryString respectively, invoked on the request object passed to the first servlet object in the forward call chain. These attributes are accessible from the forwarded servlet via the getAttribute method on the request object. Note that these attributes must always reflect the information in the target of the first forward servlet even in the situation that multiple forwards and subsequent includes are called.

      Include

      A servlet or JSP being used from within an include call has access to the path used to obtain the PortletRequestDispatcher. >The following request attributes must be set:

      javax.servlet.include.request_uri; javax.servlet.include.context_path; javax.servlet.include.servlet_path; javax.servlet.include.path_info; javax.servlet.include.query_string;

      These attributes are accessible from the included servlet using the HttpServletRequest object getAttribute method and their values must be equal to the request URIcontext pathservlet pathpath info, and {{query string}}of the included servlet, respectively. If the request is subsequently included, these attributes are replaced for that include.

      In Liferay, the expected values are actually return values of HttpServletRequest.getRequestURI(), etc. on the target servlet of the first dispatch (include). Then in the second servlet (which is the target of the forward), the test cases fail because javax.servlet.forward attribute values obtained from the http servlet request doesn't equal the expected values.

      The problem exists in our PortletServletRequest. The class has a field _include which is set to true when created during the first dispatching. However, it's not set to false for the second dispatching, which is forward.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dante.wang Dante Wang
              Reporter:
              dante.wang Dante Wang
              Recent user:
              Dante Wang
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 23 weeks, 6 days ago

                  Packages

                  Version Package