struts中request不能得到已保存的对象

kitty5423 2007-07-23 09:13:52
各位大虾:
我在action中有以下调用:
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RegForm regForm = (RegForm) form;// TODO Auto-generated method stub
String userName=((RegForm)form).getUsername();
System.out.println(userName);
PersonBean pb=new PersonBean();
pb.setUserUame(userName);
pb.saveToPersistantStore();
request.setAttribute("personName", pb);
request.setAttribute("a1", "aaa");
System.out.println("personName saved...");
//request.removeAttribute(mapping.getAttribute());
return mapping.findForward("showinfo2");
}
然后在showinfo2对应的forward页面中这样写:
<logic:present name="personName" scope="request">

<bean:write name="personName" property="userName"/>
</logic:present>
可是这里的语句总是没有执行,也就是request保存的对象在这里没有找到,请教各位大虾,这是怎么回事?
...全文
297 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhoujun_sun 2008-09-04
  • 打赏
  • 举报
回复
如何解决的?关注!
kitty5423 2007-07-23
  • 打赏
  • 举报
回复
问题已解决,谢谢大家!
snowfox_1028 2007-07-23
  • 打赏
  • 举报
回复
好象是跟你的scope 有关在showinfo2中的你把作用域去掉试试

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧