1 5 package servletunit.struts.tests; 6 7 import org.apache.struts.actions.DispatchAction; 8 import org.apache.struts.action.ActionForward; 9 import org.apache.struts.action.ActionMapping; 10 import org.apache.struts.action.ActionForm; 11 12 import javax.servlet.http.HttpServletRequest ; 13 import javax.servlet.http.HttpServletResponse ; 14 import javax.servlet.ServletException ; 15 import java.io.IOException ; 16 17 public class MyDispatchAction extends DispatchAction { 18 19 public ActionForward actionOne(ActionMapping mapping, 20 ActionForm form, 21 HttpServletRequest request, 22 HttpServletResponse response) 23 throws IOException , ServletException 24 { 25 return mapping.findForward("action1"); 26 } 27 28 public ActionForward actionTwo(ActionMapping mapping, 29 ActionForm form, 30 HttpServletRequest request, 31 HttpServletResponse response) 32 throws IOException , ServletException 33 { 34 return mapping.findForward("action2"); 35 } 36 37 public ActionForward actionThree(ActionMapping mapping, 38 ActionForm form, 39 HttpServletRequest request, 40 HttpServletResponse response) 41 throws IOException , ServletException 42 { 43 return new ActionForward(mapping.getInput()); 44 } 45 46 } 47 | Popular Tags |