Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

500 internal error on requestDispatcher.forward

$
0
0

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!


Viewing all articles
Browse latest Browse all 12476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>