REL = file-list href = "./ Learn Small .files / FileList.xml"> Rel = Edit-Time-Data HREF = "./ Learn Small .files / EditData.mso">
1
1.RequestDispatcher.forward ()
It is a role in the server. When using Forward (), servlet Engine passes the HTTP request from the current Servlet or JSP to another servlet, JSP, or ordinary HTML file, that is, your Form is submitted to A.jsp, in A. JSP uses Forward () redirect to B.JSP, all information submitted by Form can be obtained in B.JSP, and the parameters are automatically passed.
However, forward () cannot redirect to the JSP file with Frame, you can redirect to an HTML file with Frame, and forward () cannot be passed on the back of the parameters, such as servlet? Name = frank, this is not, you can pass RESPONSE .setttribute ("Name", Name) to the next page.
Redirect the browser address bar URL unchanged.
Example: Getween servlet file
2.Response.sendRedirect ()
Is working on the user's browser, sendRedirect () can be passed with parameter passes, such as servlet? Name = frank to the next page, and it can redirect to different hosts, and the browser address bar The URL of the orientation page.
SendRedirect () can redirect a JSP file with Frame.
Example: Getween servlet file
/ **
* Author email: fuhx@gasoft.com.cn
* /