request.getSession()&request.getSession(boolean)
2009-03-04 08:45
351 查看
HttpRequest对象有两种形式的getSession方法调用:
一个是getSession(),
另一个是getSession(boolean isNew)
这样的,前者会检测当前时候有session存在,如果不存在则创建一个,如果存在就返回当前的。
getSession()相当于getSession(true),
参数为true时,若存在会话则返回该会话,否则新建一个会话。
参数为false时,若存在会话则返回该会话,否则应该返回一个NULL
一个是getSession(),
另一个是getSession(boolean isNew)
这样的,前者会检测当前时候有session存在,如果不存在则创建一个,如果存在就返回当前的。
getSession()相当于getSession(true),
参数为true时,若存在会话则返回该会话,否则新建一个会话。
参数为false时,若存在会话则返回该会话,否则应该返回一个NULL
相关文章推荐
- request getsession() getsession(boolean create) invalidate() 说明
- request.getRealPath("/");替换为request.getSession().getServletContext().getRealPath("/");
- 关于session.invalidate()、request.getSession(boolean)的一点实验
- request.getSession()和request.getSession(true/false)的理解
- request.getSession().getServletContext().getRealPath("/");
- request.getSession(false),request.getSession()和request.getSession(true)的区别
- request.setattrbute()&request.getsession.setattribute()
- request getsession() getsession(boolean create) invalidate() 说明
- request.getSession(boolean create)的正确使用姿势
- request.getSession()与getSession(boolean isNew)
- request getsession() getsession(boolean create) invalidate() 说明
- request.getSession(true) request.getSession(false) request.getSession()
- request.getSession(false)&request.getSession(true)的区别
- HttpSession javax.servlet.http.HttpServletRequest.getSession(boolean arg0)理解
- Attribute value request.getParameter("itemID") is quoted with " which must be escaped when used with
- 20110215 学习记录2:表单中的get和post区别 & 使用 HttpWebRequest 向网站提交数据
- 对request.getSession(false)的理解(附程序员常疏忽的一个漏洞)
- 当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到
- getSession(true)和getSession(),有什么区别
- Forward & Redirect & Request getParameter/getAttribute 理解