A servlet forwards a request to a JSP page for rendering the view. Which method does it use, and what happens to the URL in the browser?

  • request.getRequestDispatcher().forward()
  • request.sendRedirect()
  • response.forward()
  • response.sendRedirect()
The correct method for forwarding a request to a JSP page is request.getRequestDispatcher().forward(). The URL in the browser remains the same as the original request URL.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *