怎么从一个action跳到另一个action,跳的时候要带参数。
高手们帮帮忙,感激不尽
------解决方案--------------------
struts Action跳到Action是这样做的
根据你xml配置的<forward name="test" path="/index/test.do" />
用 mapping.findForward("test");跳转test就是forward name
你想传值request.setAttribute("名", 值);放到request作用于里就好了
在那个action Get出来,根本不需要url传值
- Java code
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // TODO Auto-generated method stub String id = request.getParameter("id"); String step = request.getParameter("step"); HttpSession session = request.getSession(true); if (id!=null && "".equals("id")!=true) { List list = tbiz.GetQuestionByqid(Integer.parseInt(id)); session.setAttribute("qlist", list); request.setAttribute("step", list.get(0)); request.setAttribute("s", 0); return mapping.findForward("test"); }}