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,本页面可以取出值来,刷新或打开新页面值能取出来了.
......
我的开发的平台是Myeclipes6.0 + tomcat5.x + mysql
我所有的编码方式都是用的UTF-8
我只用了Strtus框架
在一个form中如下用的是post的提交方式:
<form class="form" action=&quo ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
jsp中include.inc的作用是什么?
include.inc啥意思?没听说过
Java code:
<%include file="include.inc"%>加载网站目录include.inc文件内容
包含一个静态页面吧···
& ......
jsp开发的时候能够导出word和excel,但是是否能够直接导出为acess格式、dbf格式的文件?
高手指点下,最好能够给个例子,谢谢!!!
javadbf这个jar一切问题解决了。
下载地址为:http://sarovar.org/projects/ ......