9 Replies Latest reply on Mar 2, 2013 1:28 PM by Sham HC

    500 internal error on requestDispatcher.forward



      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!