您的位置:首页 > 产品设计 > UI/UE

getSession(true)和getSession(),有什么区别

2009-04-27 15:14 357 查看
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.

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
帮助上是这么说的,
但实际用起来好像 getSession(true)有时会自动创建一个新的session,而把原来的session替换掉
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: