在jsp主页面显示 “欢迎你 你是第++个登陆本网页” 代码怎么写  请大家帮帮忙

解决方案 »

  1.   

    用application .
       List loginUser=new ArrayList();   //访问列表
         if(....)
       {
                  
       }
      loginUser.add(...)
       application.setAttribute("Login",loginUSer);
      

  2.   

    登陆时记录是第几个登陆的,可直接入到request中,如:request.setAttribute("count",count);
    在页面要显示的位置直接用${count}就可以了。
      

  3.   

    顶一楼的,用application,但只要存放登录人数就行了,application中存的东西多了很占内存的
      

  4.   

    application 可以,或者使用监听器
      

  5.   

    其实运作起来,还是复杂的
    <%
    Integer count=application.getAttribute("count");
    if (count==null)
      count=new Integer(0);
    count++;
    application.setAttribute("count",count);
    out.println(count);
    %>