Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-24597

[GSS](7.4.z) UNDERTOW-2245 - javax.servlet.forward.mapping request attribute is not available in servlets forwarded with RequestDispatcher

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.4.11.CR1, 7.4.11.GA
    • None
    • Undertow
    • None
    • False
    • None
    • False
    • Hide

      It can be reproduced in attached simple application test-app-src.zip:

      $ unzip test-app-src.zip
      $ cd test-app
      $./mvnw package
      $ cp target/ROOT.war JBOSS_EAP_749_HOME/standalone/deployments/
      $ JBOSS_EAP_749_HOME/bin/standalone.sh
      

      JBoss EAP 7.4.9 (actual):

      $ curl http://127.0.0.1:8080/dispatch
      request attributes:
      key: javax.servlet.forward.context_path, value: 
      key: javax.servlet.forward.servlet_path, value: /dispatch
      key: javax.servlet.forward.request_uri, value: /dispatch
      

      Tomcat 9.0.72 (expected):

      $ curl http://127.0.0.1:8080/dispatch
      request attributes:
      key: javax.servlet.forward.request_uri, value: /dispatch
      key: javax.servlet.forward.context_path, value: 
      key: javax.servlet.forward.servlet_path, value: /dispatch
      key: javax.servlet.forward.mapping, value: org.apache.catalina.core.ApplicationMapping$MappingImpl@2248cb0c  <<<===
      
      Show
      It can be reproduced in attached simple application test-app-src.zip: $ unzip test-app-src.zip $ cd test-app $./mvnw package $ cp target/ROOT.war JBOSS_EAP_749_HOME/standalone/deployments/ $ JBOSS_EAP_749_HOME/bin/standalone.sh JBoss EAP 7.4.9 (actual): $ curl http: //127.0.0.1:8080/dispatch request attributes: key: javax.servlet.forward.context_path, value: key: javax.servlet.forward.servlet_path, value: /dispatch key: javax.servlet.forward.request_uri, value: /dispatch Tomcat 9.0.72 (expected): $ curl http: //127.0.0.1:8080/dispatch request attributes: key: javax.servlet.forward.request_uri, value: /dispatch key: javax.servlet.forward.context_path, value: key: javax.servlet.forward.servlet_path, value: /dispatch key: javax.servlet.forward.mapping, value: org.apache.catalina.core.ApplicationMapping$MappingImpl@2248cb0c <<<===

      From Servlet 4.0 spec, request attribute javax.servlet.forward.mapping must be set in a forwarded servlet with RequestDispacher, but it is not set in JBoss EAP 7.4.9.

      https://javaee.github.io/servlet-spec/downloads/servlet-4.0/servlet-4_0_FINAL.pdf

      9.4.2 Forwarded Request Parameters
      ...
      The following request attributes must be set:

      • javax.servlet.forward.mapping <<<=== added from servlet 4.0
      • 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

              mshikalw Moulali Shikalwadi
              rhn-support-nagetsum Norito Agetsuma
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: