精选文章
>> 未分类的问题
>> 网页重定向
由 webmaster 发布于: 2001-01-20 16:51
1 可以使用:
response.sendRedirect("http://www.foo.com/path/error.html");
2 你可以手工修改HTTP header的Location属性,如下:
<%
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
String newLocn = "/newpath/index.html";
response.setHeader("Location",newLocn);
%>
3 也可以使用forward:
<jsp:forward page="/newpage.jsp" />
请注意你只能在任何输出还没有发送到客户端之前使用这种方式。
|