另外:
如果在页面中可以同时运行两个response.sendRedirect页面,一样的出错例如:
<%@ page contentType="text/html;charset=GB2312" %><html>
<body>
<%
response.sendRedirect("index.html");
response.sendRedirect("index.html");
%></body>
</html>我用的是tomcat+jdk1.3
如果在页面中可以同时运行两个response.sendRedirect页面,一样的出错例如:
<%@ page contentType="text/html;charset=GB2312" %><html>
<body>
<%
response.sendRedirect("index.html");
response.sendRedirect("index.html");
%></body>
</html>我用的是tomcat+jdk1.3
if(session.getValue("username")==null)||(session.getValue("roles")==null))
{
response.sendRedirect("index.html");
}
因为此时它不知道该转向哪个所以报错所以你要修改代码
<html>
<head>
<title>TEST</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<%
response.sendRedirect("/");
response.sendRedirect("/");
%>
</body>
</html>