在Struts中Action传参数 [总结]

在Struts中Action传参数 [总结]

public ActionForward userSave(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response) {
  UserForm userForm = (UserForm) form;

  return mapping.findForward("userSave");
 }

//传参数
 public ActionForward userSave(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response) {
  UserForm userForm = (UserForm) form;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 String path = mapping.findForward("delete").getPath();

  //TODO: 读取本Action所有的请求参数,将path重新构造,加上请求参数

  ActionForward forward= new ActionForward(path+"&pageId=1");
  forward.setRedirect(true);
//传参数后返回
  return forward;

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 // return mapping.findForward("userSave");
 }


你可能感兴趣的:(在Struts中Action传参数 [总结])