the difference between redirection and forwarding in a JSP:
One: Indirect request Forwarding (Redirect) Two: Direct Request forwarding (Forward)
The user sends an HTTP request to the server that may be processed by multiple information resources
Http://www.cnblogs.com/xrq730/p/4915403.htmlThe process of one redirectMy code is already written, there is a form on the redirectandfoward.jsp page and the form is redirected to redirectandfowardtarget.jsp, so this time the redirection process is:1,
1 , forwarding, and redirection httpservletresponse response forwarding: RequestDispatcher Dispatcher= Request.getrequestdispatcher ("/secondservlet");Request.setattribute ("pwd", "123");//The value set here can be obtained in the
You can use the url forwarding feature (url-forwarding or urlredirect) implemented by the server technology to forward it to a domain name with www for access. However, we have mentioned that using this url forwarding method is not good for seo. the
I. Call Method
We know that the statements for calling forwarding and redirection in servlet are as follows:Request. getrequestdispatcher ("New. jsp"). Forward (request, response); // forward to new. jspResponse. sendredirect ("New. jsp"); //
Http://www.cnblogs.com/shenliang123/archive/2011/10/27/2226892.htmlResponse.sendredirect ("http://www.foo.com/path/error.html");Redirection and forwarding have an important difference: When forwarding is used, the JSP container uses an internal
Forwarding Address: http://www.cnblogs.com/shenliang123/archive/2011/10/27/2226892.htmlResponse.sendredirect ("http://www.foo.com/path/error.html");Redirection and forwarding have an important difference: When forwarding is used, the JSP container
This article was reproduced from: http://blog.csdn.net/kobejayandy/article/details/13762043ForwardThe principle of forwarding can be demonstrated by:The browser's request is sent to component 1, component 1 after some processing, the request and the
In Javaweb, HttpServletRequest and HttpServletResponse are almost the necessary parameters to handle various requests and operations, compared to the original servletrequest/servletresponse. They conform to the HTTP protocol, so start with the HTTP
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.