Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5450

ServletDispatcherResult Forwarding GET Instead of FORWARD

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 7.0.0
    • 7.0.0
    • Core
    • None

    Description

      I am running Struts "7.0.0-M9" along with Spring Boot "3.3.2" + Spring Security with embedded tomcat version is "10.1.26"

       

      Environment:

      Struts 2 "7.0.0-M9"

      Spring Boot "3.3.2"

      Tomcat "10.1.26"

      Java 21

       

      I have a Struts Action class annotated with :

      @Result( 
        name = Action.INPUT,
        location = "/WEB-INF/content/%{#request.device}/login.jsp",
        type = "dispatcher"
      )

       I have noticed that after returning from the Action class (ViewLoginAction.java) the framework is invoking the above JSP using a DispatcherType.GET instead of DisplatcherType.FORWARD.

      StrutsRequestWrapper is missing request attribute "jakarta.servlet.forward.request_uri"

      Then, tomcat "org.apache.catalina.core.ApplicationDispatcher" doForward method fails to find that attribute in the following line:

      if (hrequest.getAttribute(FORWARD_REQUEST_URI) == null)
      { 
        ...
        ...
        // then tomcat defaults to setting value of various request attributes 
        ...
        ...
      }
       
      

       

      And after that, tomcat calls "processRequest(request, response, state);" in the same instance "ApplicationDispatcher" and fails to resolve a FORWARD dispatcher type below.

       

      Instead, it resolves a REQUEST. And when tomcat sees REQUEST dispatcher type it does a GET on the JSP, instead of FORWARD.

       

      Should StrutsRequestWrapper have request attribute "jakarta.servlet.forward.request_uri"?  If not why tomcat is resolving a GET instead of FORWARD? 

       

      I do not see this issue with Struts 6.6.0 + Spring 2.7.18 with embedded Tomcat "9.0.83". which is based on javax.servlet instead.

       

      Rubens Gomes

       

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            rubensgomes Rubens Gomes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h