在登录页面把用户名放在request或session等变量里面传过来
在第二个页面接收就是了

解决方案 »

  1.   

    在开始的地方设定:
    HttpSession session=request.getSession(true);
    session.setAttribute("strSql",sql);
    下面再别的地方接收提取:
    HttpSession session=request.getSession(true);
    String sql = (String)session.getAttribute("strSql");
    Sql就是你所要的参数
      

  2.   

    String username1=(String) session.getValue("username")
       好像这样也行的
        我用的就是这句
      

  3.   

    还有要是你要用 username1 的话 你就
      username =myRs.getString("username1 ")