<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
out.print("<jsp:forward page=\"/In_1.jsp\"/>");
%>
</script> 
</body>
</html>
这样写原理上可不可以啊?
我怎么老出错

解决方案 »

  1.   

    出什么错啊
    不行用js: window.location.replace(url);
      

  2.   

    老奇怪了,不加out.print  直接写在外面就对 ,但那样就跟if语句连不起来了,郁闷
      

  3.   

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
        pageEncoding="ISO-8859-1"%> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
    <title>Insert title here </title> 
    </head> 
    <body> 
    <jsp:forward page="/In_1.jsp"/> 
    </body> 
    </html> 
      

  4.   

    window.location="In_1.jsp";

    widnow.location.href="In_1.jsp";
      

  5.   

    你那里面在怎么写也是print啊...
      

  6.   

    out.print(" <jsp:forward page=\"/In_1.jsp\"/>"); 
    一点也不奇怪
    <jsp: ...>是标签 不需要通过out.print的 JSP自己会分析out.print 是把内容显示给用户看 用户看到的时候 已经没人帮他分析 JSP标签了
      

  7.   

    恩,谢谢各位,用window.location.replace解决问题了