struts中request不能得到已保存的对象
各位大虾:
我在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保存的对象在这里没有找到,请教各位大虾,这是怎么回事?