Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-444

After dispatching via include in SAM, the include is again loaded instead or target resource

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0.Beta1, 1.2.8.Final
    • None
    • None
    • None

      When a SAM dispatches to a simple Servlet via an include, then after the SAM returns SUCCESS and the requested Servlet should be loaded, Undertow instead loads the include again.

      For example, consider a request to a public Servlet mapped to /servlet, another Servlet mapped to /includedServlet and a SAM with the following code:

      HttpServletRequest request = (HttpServletRequest) messageInfo.getRequestMessage();
      HttpServletResponse response = (HttpServletResponse) messageInfo.getResponseMessage();
      
      request.getRequestDispatcher("/includedServlet")
             .include(request, response);
      
      CallerPrincipalCallback(clientSubject, (Principal) null) });
      
      return SUCCESS;
      

      After this SAM has executed, Undertow will proceed to invoke /includedServlet for a second time instead of invoking the expected /servlet

      A reproducer is available here: https://github.com/javaee-samples/javaee7-samples/tree/master/jaspic/dispatching

            sdouglas1@redhat.com Stuart Douglas
            arjan.tijms@gmail.com Arjan Tijms (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: