I want to know is there any way to forward servlet request and response from a rest webservice to a servlet.. I have a servlet on remote server from which i am calling webservice to get the request params and then i want it to forward to another servlet from that webservice.I tried some code but it does not work. Please give me suggestions if anyone had worked on it.
this is my rest web code snippet
@GET
@Path("/test")
public void requestToTelkom(@Context HttpServletRequest request,@Context HttpServletResponse response ) {
try {
// the request object is printed successfully
System.out.println(request);
// when i try to forward like this i get exceptions
RequestDispatcher rd = request
.getRequestDispatcher("BypassServlet");
rd.forward(request, response);
} catch (ServletException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I got this exception with above code
UT010023: Request io.undertow.servlet.spec.HttpServletRequestImpl@53b21177 was not original or a wrapper