A. Requestdispatcher.forward ():
is the server-side effect. When using forward (), the Servlet container passes HTTP requests from the current servlet or JSP to another servlet,jsp or normal HTML file, which means that your form is submitted to a.jsp and forward () is used in a.jsp. Redirect to B.jsp. All information submitted by Form at this time is available in b.jsp, and parameters are automatically passed.
Forward () cannot be redirected to a JSP file with a frame, which can be redirected to an HTML file with a frame, while forward () cannot be passed back with parameters such as Servlet?name=frank, which is not possible. You can pass Response.setattribute ("name", name) to the next page within your program.
The browser address bar URL does not change after redirection. Typically used in a servlet and not used in a JSP.
B . Response.sendredirect ()
is working on the user's browser side. Sendredirect () can be passed with parameters, such as Servlet?name=frank to the next page, and it can be redirected to different hosts, Sendredirect () can redirect the JSP file with frame.
After redirection, the URL of the redirected page appears on the browser's address bar.
C . <jsp:forward page= ""/>
Its underlying part is implemented by RequestDispatcher, so it carries the imprint of the Requestdispatcher.forward () method if there is a lot of output before <jsp:forward>, the previous output has the buffer full, will be automatically exported to the client, the statement will not work, and this should be particularly noted. Also note: It can not change the browser address, the refresh will result in duplicate submission