怎么用session自动保存密码 怎么用session自动保存密码?登陆后将密码自动记住!最好有个实例!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本人自己做的网页,因为分页时,提交到登陆的Action导致帐号密码为空,而出错!就是为了解决这个问题的 session.setAttribute("loginUser",user); 自动保存不知道怎么搞,我只会手动自己去保存.Session.setAttribute(key,value); Session.getAttribute(key). 保存在Action 中还是Jsp上都可以,但是要保证登陆成功后,在返回不会报帐号和密码空指针错误! 登陆后保存在session中,退出清除session.设置:Session.setAttribute(key,value); 取值:Session.getAttribute(key);清除:session.invalidate(); 说清楚点阿,比如在JSP上写:loginname:<html:text property="loginname" /><html:errors property="loginname" /><br />password:<html:text property="password" /><html:errors property="password" /><br/> 在这之前或之后写 Session.getAttribute(key); 或者在Action中写,在 if(loginname.equals(info.getLoginName())&&(password.equals(info.getPassWord()))){语句之前或之后写Session.setAttribute(key,value); 总之写清楚一点好吗?还有key和value到底是指什么,写清楚,谢谢 名值对 key == 保存到session的实例名(名字随便,方便下次调用) value == 保存到session中的实例(例如你要保存的user实例) 把登陆密码 放到 SESSION 里面 GET 一下 不就完事了 我觉得前面几楼已经解决了啊~~~在Action里加几句:request.getSession().setAttribute("userName", userName);request.getSession().setAttribute("blogID", blogID);request.getSession().setAttribute("blogName", blogName); 【爬虫】使用Post方法爬取网页,但是获取到的是原网页 关于tomca6服务器集群的问题? xml格式字符串如何转换成树形结构 做项目的问题 fckeditor使用 基于模式和框架下的一个模块:员工考勤系统 请高手查错! 有没有一个API函数能将一个以含有“,”号的字符串以“,”作为分隔符分开赋给一个字符串数组 如何在web上打印Jasperreport报表文件,打印制作出来的.jasper文件 在ssh框架里搭了一个websocket连接,连接不上 websphere中对servlet进行支持的lib是哪个 如何用*.bat调用java程序
设置:Session.setAttribute(key,value);
取值:Session.getAttribute(key);
清除:session.invalidate();
loginname:<html:text property="loginname" /><html:errors property="loginname" /><br />
password:<html:text property="password" /><html:errors property="password" /><br/>
在这之前或之后写 Session.getAttribute(key);
或者在Action中写,在
if(loginname.equals(info.getLoginName())&&(password.equals(info.getPassWord()))){
语句之前或之后写Session.setAttribute(key,value);
总之写清楚一点好吗?
还有key和value到底是指什么,写清楚,谢谢
value == 保存到session中的实例(例如你要保存的user实例)
GET 一下 不就完事了
我觉得前面几楼已经解决了啊~~~
在Action里加几句:
request.getSession().setAttribute("userName", userName);
request.getSession().setAttribute("blogID", blogID);
request.getSession().setAttribute("blogName", blogName);