Steps used to reproduce:

      1. Start the portal on Tomcat (Reproduced with JBoss too, but not tested with others.)
      2. Deploy the attached 'service-pre-exception-test-hook-' which sets a custom service-pre action that simply throws an exception at each request.
      3. Go to the welcome page using url http://localhost:8080 and you'll see the content of service-pre error page rendered correctly ( - see attached screenshot master_error_page.png
      4. Go to the welcome page using url http://localhost:8080/web/guest/home

      Actual behavior:
      Stacktrace is rendered instead of the error page - see attached screenshot master_HTTP_500.png

      The error page content should be rendered just as for URL http://localhost:8080

      Techincal Background
      We set javax.servlet.jsp.jspException attribute on the request. This has benefits for us like the exception object becomes accessible from within error pages (we forward to through RequestDispatcher), and drawbacks like HTTP 500 is set on response, app server's error page processing mechanism is triggered and app server is looking for the corresponding error page definition in web.xml. This way the content of our custom "error page" we forwarded to won't be rendered (except some unpredictable scenarios).

      According to section 10.9 Error Handling of Servlet 3 spec. error handling depends on the presence of request attributes named like javax.servlet.error.*. Cleaning up those attributes as well as javax.servlet.jsp.jspException avoids the mechanism to step in and allows proper rendering of the custom page we forwarded to.


          Issue Links



              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created:
                  Days since last comment:
                  2 years, 24 weeks, 4 days ago


                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP21
                  7.0.0 DXP SP4
                  7.0.X EE