What is the difference between sendRedirect() and forward()?
Response.sendRedirect (): This function is used, when we want to redirect the client request to some other site (i.e out of our context) or when ever we want to redirect errors. If you are using sendRedirect (), then it will be visible to the client that means the URL which you have been redirected will be visible in the address bar. Redirect response to the client using the specified redirect location URL.
Forward() : This can be done in two ways by Request & ServeletContext. Forwarding a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. Forward is done at server side, without the client?s knowledge.