码迷,mamicode.com
首页 > Web开发 > 详细

简述HttpSession的作用、使用方法,可用代码说明

时间:2018-10-05 10:46:23      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:方法   setattr   attribute   取出   get   ssi   使用方法   范围   作用   

HttpSession中可以跟踪并储存用户信息,把值设置到属性中,有2个方法:setAttribute(),getAttrribute();

例如:在一个方法中用session.setAttribute(“student”,student);在session中设置一个属性名为student,值为一个名为student的对象。而后可在同一session范围内用getAttribute(“student”)取出该属性,得到student对象。

简述HttpSession的作用、使用方法,可用代码说明

标签:方法   setattr   attribute   取出   get   ssi   使用方法   范围   作用   

原文地址:https://www.cnblogs.com/yuyu666/p/9743979.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!