请求转发的两种方式
1 <%--response.sendRedirect("http://www.bilibili.conm"); --%>
2 <%response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
String newLocation = "http://www.baidu.com";
response.setHeader("Location",newLocation);
%>
本文介绍了两种请求转发的方法:一是使用response.sendRedirect进行重定向;二是通过设置状态码为SC_MOVED_PERMANENTLY并利用response.setHeader('Location', newLocation)来实现永久重定向。这两种方法在Web开发中十分常见。
请求转发的两种方式
1 <%--response.sendRedirect("http://www.bilibili.conm"); --%>
2 <%
9054

被折叠的 条评论
为什么被折叠?