12 package com.jacktan.struts.formbean; 34 import java.util.*; 5 import javax.servlet.http.*; 6 import org.apache.struts.action.*; 8 public class CustomForm extends ActionForm { 10 private Map formvalueMap = new HashMap(); 12 public void setFormvalueMap(Map p_FormvalueMap){ 14 this.formvalueMap = p_FormvalueMap; 15 } 16 public Map getFormvalueMap(){ 18 return this.formvalueMap; 19 } 20 public void setFormvalue(String key,Object value){ 22 formvalueMap.put(key,value); 23 } 24 public Object getFormvalue(String key){ 26 return formvalueMap.get(key); 27 } 28 } |
12 package com.jacktan.struts.action; 34 import java.util.*; 5 import javax.servlet.http.*; 6 import org.apache.struts.action.*; 8 import com.jacktan.struts.formbean.CustomForm 10 public class CustomAction extends Action { 12 public ActionForward execute(ActionMapping p_Mapping, 15 ActionForm p_Form, 16 HttpServletRequest p_Request, 17 HttpServletResponse p_Response) 18 throws Exception{ 21 Map formvalues =((CustomForm)p_Form).getFormvalueMap(); 23 return p_Mapping.findForward("Success"); 25 } 26 } |