jsp页面无法获取action传来的session
//登录
public ActionForward doLogin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws IOException {
UserForm userForm = (UserForm) form;
UserInfo ui=userForm.getUserInfo();
ui=ub.login(ui.getDyzh(), ui.getPwd());
session=request.getSession();
session.setAttribute("current_user", ui);
request.setAttribute("if_user", "yes");
return mapping.findForward("updatePwd");
}
//修改密码
public ActionForward doUpdatePwd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws IOException
{
UserForm userForm = (UserForm) form;
UserInfo ui=userForm.getUserInfo();
UserInfo ui2=ub.getUserByNamePwd(ui.getDyzh(), ui.getPwd());
ub.updatePwd(ui.getDyzh(), ui.getNewPwd());
ub.updateState(ui.getDyzh(),1);
UserInfo ui3=(UserInfo)session.getAttribute("current_user");
ui3.setPwd(ui.getNewPwd());
ui3.setState(1);
session.setAttribute("current_user", ui3);
return mapping.findForward("main");
}
上面两个方法是action里的方法,由上可知:
在登录方法里,我创建了session.setAttribute("current_user",
相关问答:
我在jsp页面存上一个session,本页面还可以取出值来.
但是一刷新,或者打开新的页面就取不出值来了.
奇怪的是,我测试另一个程序时候
在jsp页面存上一个session,本页面可以取出值来,刷新或打开新页面值能取出来了.
......
问题1.
如何通过RandomAccessFile类的seek()方法将指针移动到文件末尾,再用writeChars(String s)将数据写入某个文档文件
问题2.
StringTokenizer是什么东西,干嘛用的?
由于小弟初学js ......
//用客户的session的id建立一个临时文件:
//String tempFileName=(String)session.getId();
String tempFileName = (String)session.getId();
//out.println(& ......
我刚做好一个jsp的购物商城,可我不会怎么发布到网上!有谁能帮帮我
可以自己租用一台服务器配置,关于上传的话,就是用上传软件,把你的程序传到服务器上。
mark
打个war包放上去就行了
咋听你们说的这 ......
问题描述:
例如我要显示的内容如下所示
一级目录1
一级目录1子类1
子类1
一级目录1子类2
......