2、session的创建和销毁

  1. sesssion.removeAttribute()方法和session.invalidate()方法的区别:前者只能销毁某一个session,而后者销毁客户端所有的session,释放session所占用的资源;
  2. session.setMaxInactiveInterval(int args);方法:设置session的持久时间,以秒为单位;如果值小于0,则不限制session处于不活动状态的时间;
  3. session.getValue("username")方法:The method getValue(String) from the type HttpSession is deprecated  表示该方法已经弃用,要获取session的值请用session.getAttribute()方法;




posted @ 2014-04-08 23:57  zmpandzmp  阅读(311)  评论(0编辑  收藏  举报