Hello,
Is it possible to use the RequestDispatcher.forward() method to forward to a
servlet in a different context path?
For example:
I have the following
jsp:
http://localhost:8080/app1/index.jsp ...that tries to forward to:
http://localhost:8080/app2/myServlet Here is the code that I am using in index.jsp:
RequestDispatcher rd = request.getSession().getServletContext().getRequestDispatcher("/app2/myServlet");
rd.forward(request,response);
It returns null.
I could use:
response.sendRedirect("/app2/myServlet");
But that sends the response back to the user before requesting the servlet, and would rather not use it if possible. :-/
Thanks!
David