当前位置: 代码迷 >> J2EE >> struts 1.2 跳转 action 到另一个action,该如何处理
  详细解决方案

struts 1.2 跳转 action 到另一个action,该如何处理

热度:487   发布时间:2016-04-22 02:36:31.0
struts 1.2 跳转 action 到另一个action
我实现的是 从一个 struts中的action 控制页面 跳到 另一个 action控制页面 怎么实现
例如:
public class DealChooseCourseAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {


}
  }
跳转到 到
public class ChooseCourseAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {


}
}
请高手指点 给出解决的代码 多谢

------解决方案--------------------
你在A action中,return mapping.findForward("XXXX");
在struts-config.xml中,配置<forward name="XXXX" path="/B.do" />,就跳转到B action了
  相关解决方案