thanks!
response.setHeader("Pragma","no-cache")  ???

解决方案 »

  1.   

    http://172.xx.x.xx"登录本机进行测试时,所有的页面均会执行两次.What are your meaning?
    paste your program or mail ot me
    [email protected]
      

  2.   

    <%@ page language="java" import="java.sql.*" contentType="text/html;charset=gb2312"%> 
    <% 
    String name=request.getParameter("name"); 
    String pwd=request.getParameter("passwd"); 
    session.setAttribute("User",name); 
    String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver"; 
    String sConnStr = "jdbc:odbc:Web"; 
    String sql="Select * from 用户信息 where 用户名='"+name+"'"; 
    Connection conn = null; 
    Statement stmt=null; 
    ResultSet rs = null; 
    System.out.println("aaaa"); //在后台打出aaaa,从而知道执行次数
    try { 
    Class.forName(sDBDriver); 
    conn = DriverManager.getConnection(sConnStr,"abc","abc"); 
    stmt = conn.createStatement(); 
    rs = stmt.executeQuery(sql); 
    String strname=""; 
    String strpwd=""; 
    while (rs.next()){ 
      strname=rs.getString("用户名").trim(); 
      strpwd=rs.getString("密码").trim(); 
    }//while 
    rs.close(); 
    stmt.close(); 
    conn.close(); if ((name.equals(strname))&&(pwd.equals(strpwd))) 

    %> 
    <jsp:forward page="Main.jsp"/> 
    </jsp:forward> 
    <% 
    }//if 
    }catch(SQLException ex) { 
    System.err.println("LoginJsp: " + ex.getMessage()); 

    %> thanks a lot!
      

  3.   

    Select * from 用户信息 where 用户名='"+name+"'"; how many records return?
      

  4.   

    to gzwrj(redwing):
    对不起,刚刚看到
    数据库中的记录肯定是唯一的!
    谢谢!