-
2、session的创建和销毁
- sesssion.removeAttribute()方法和session.invalidate()方法的区别:前者只能销毁某一个session,而后者销毁客户端所有的session,释放session所占用的资源;
- session.setMaxInactiveInterval(int args);方法:设置session的持久时间,以秒为单位;如果值小于0,则不限制session处于不活动状态的时间;
- session.getValue("username")方法:The method getValue(String) from the type HttpSession is deprecated 表示该方法已经弃用,要获取session的值请用session.getAttribute()方法;
-
相关阅读:
抽象工厂模式
外观模式
策略模式
状态模式
观察者模式
装饰者模式
模板方法模式
适配器模式
中介者模式
组合模式
-
原文地址:https://www.cnblogs.com/zmpandzmp/p/be0972b27e35bd075bb224005294c9ea.html
Copyright © 2020-2023
润新知