500 internal error on requestDispatcher.forward for Experience Manager | Community
Skip to main content
Community_Admin
Adobe Employee
Adobe Employee
October 16, 2015
Solved

500 internal error on requestDispatcher.forward for Experience Manager

  • October 16, 2015
  • 1 reply
  • 1151 views

Hi

We have a form when submitted calls a webservice and may return error messages as response. We need to redirect to same page posting the error.

 

trying with this code in POST.jsp of the form, but it returns a 500 server error and couldnt find anything in logs:

 

 

SlingHttpServletRequest req =

       new SlingHttpServletRequestWrapper(((SlingHttpServletRequest)slingRequest )) {

           public String getMethod() {

               return "GET";

          }

       };

    

       // req.setAttribute("PARAMS", paramsMap);

              

        slingRequest = (SlingHttpServletRequest)req;

        RequestDispatcherOptions requestDispatcherOptions = new RequestDispatcherOptions();       

        RequestDispatcher requestDispatcher = req.getRequestDispatcher(req.getRequestURI(), requestDispatcherOptions);

     

      if(requestDispatcher != null)

        requestDispatcher.forward(req, response);        

 

 

Any pointers on what could be wrong here? Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Community_Admin

Details of error handling at http://sling.apache.org/site/errorhandling.html

Create a file Throwable.jsp at [1] & Have your custom implementation to handle server internal error.

 

[1]  /apps/sling/servlet/errorhandler/Throwable.jsp

1 reply

Community_Admin
Adobe Employee
Community_AdminAdobe EmployeeAuthorAccepted solution
Adobe Employee
October 16, 2015

Details of error handling at http://sling.apache.org/site/errorhandling.html

Create a file Throwable.jsp at [1] & Have your custom implementation to handle server internal error.

 

[1]  /apps/sling/servlet/errorhandler/Throwable.jsp