1 18 19 package org.apache.struts.webapp.exercise; 20 21 import javax.servlet.http.HttpServletRequest ; 22 import javax.servlet.http.HttpServletResponse ; 23 import org.apache.struts.action.Action; 24 import org.apache.struts.action.ActionForm; 25 import org.apache.struts.action.ActionForward; 26 import org.apache.struts.action.ActionMapping; 27 import org.apache.struts.action.DynaActionForm; 28 29 public class DynaSetAction extends Action 30 { 31 public ActionForward execute(ActionMapping mapping, 32 ActionForm form, 33 HttpServletRequest request, 34 HttpServletResponse response) 35 throws Exception { 36 37 DynaActionForm dynaActionForm = (DynaActionForm) form; 38 39 dynaActionForm.set("foo", "alpha"); 40 dynaActionForm.set("bar", "beta"); 41 42 return (mapping.findForward("success")); 43 } 44 } 45 | Popular Tags |