request.getSession(true)和request.getSession(false)的区别

来源:互联网 发布:治疗近视知乎 编辑:程序博客网 时间:2024/04/30 10:34

request.getSession(true):若存在会话则返回该会话,否则新建一个会话。
request.getSession(false):若存在会话则返回该会话,否则返回NULL

后者经常用于检测是否存在session

原创粉丝点击