这是检验登录界面
<%@ page import="station.run.login,station.util.DataBase" %><jsp:useBean id="loginId" scope="page" class="station.run.login"></jsp:useBean>
<jsp:setProperty name="loginId" property="*"/>
<%@ page import="java.sql.*;" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<% loginId..setSqlProxy(new SQLProxy());%><%
if(loginId.excute()==false){
%>
<strong> </strong>
<% }else{%>
<a href="userLogin.jsp">
<jsp: forward page="userLogin.html"/>
</a>

<% }%></body>
</html>
可是页面没有跳转到userLogin.html,无论在表单中填什么都会跳到此页面来

解决方案 »

  1.   

    <jsp:forward>是属于服务端跳转,地址栏上的地址不会发生改变,是试用response.sendRedirect("userLogin.html")
      

  2.   

    谢谢回复!
    我改了试了一下还是不行,而且我象下面这样直接判断
    <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><%@ page import="java.lang.*,java.sql.*" %><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>login2.jsp</title>
    </head><body>
    <%
    if( request.getParameter("username")equals("user1") && !request.getParameter("passwd").equals("user1"))
    {        
                response.sendRedirect("Myindex.jsp");
    }
    else{
        out.println("error!");
    }
    %></body>
    </html>
    也是跳到了login2.jsp      不能跳转到Myindex.jsp
    这是怎么回事呢