request.getSession(true) and request.getSession(false)
2012-08-19 21:24
411 查看
getSession
public HttpSession getSession(boolean create)Returns the current HttpSession associated with this request or, if if there is no current session and create is true, returns a new session.
If create is false and the request has no valid HttpSession, this method returns null.
To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create
a new session when the response is committed, an IllegalStateException is thrown.
Parameters:
true - to create a new session for this request if necessary; false to return null if there 's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
public HttpSession getSession(boolean create)Returns the current HttpSession associated with this request or, if if there is no current session and create is true, returns a new session.
If create is false and the request has no valid HttpSession, this method returns null.
To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create
a new session when the response is committed, an IllegalStateException is thrown.
Parameters:
true - to create a new session for this request if necessary; false to return null if there 's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
相关文章推荐
- 【转】于request.getSession(true/false/null)的区别
- 关于request.getSession(true/false/null)的区别
- 有关request.getSession参数(true或者false)的含义
- request.getSession(true) request.getSession(false) request.getSession()
- request.getSession(false)&request.getSession(true)的区别
- request.getSession(false)与request.getSession(true)区别
- 有关request.getSession参数(true或者false)的含义
- request.getSession(true)和request.getSession(false)的区别
- request.getSession(true)和request.getSession(false)的区别
- request.getSession(true)和request.getSession(false)的区别
- request.getSession() 与 request.getSession(true/false)有何区别?
- request.getSession(false),request.getSession()和request.getSession(true)的区别
- 关于request.getSession(true/false/null)的区别
- request.getSession(true)和request.getSession(false)的区别
- 关于request.getSession(false)和request.getSession(true)测试与Andriod模拟浏览器处理session机制的实现
- request.getSession(true)和request.getSession(false)的区别
- java 中 request.getSession(true、false、null)的区别
- request.getSession(true)和request.getSession(false)的区别
- 转:request.getSession(true)和request.getSession(false)的区别
- request.getsession(true)和request.getsession(false)的区别