The first implementation method:
678572ad9da19314f4cfa0e5e6a319ee It can realize the function of redirecting to the include.jsp page
It is equivalent to the page redirection in Servlet:
RequestDispacher rd = request.getRequestDispacher("include.jsp");rd.forward(request, response);
The second implementation method:
response.sendRedirect("include.jsp");
The second implementation method: Equivalent to:
response.setStatus(302);response.setHeader("location", "include.jsp");
The difference between the two:
The first one:
Readable The request object before redirection; the address after redirection does not change and is still the original address; it cannot be redirected to pages other than this web project; it sends a request to the server once and the speed is relatively fast
The second type:
Not possible Read the request object before redirection; the address after redirection changes to the address of the redirected target page; it can be redirected to pages other than this web project; sending two requests to the server is relatively slow
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn