1 7 package com.inversoft.verge.mvc.controller.form; 8 9 10 import javax.servlet.http.HttpServletRequest ; 11 import javax.servlet.http.HttpServletResponse ; 12 13 import com.inversoft.beans.BeanException; 14 import com.inversoft.verge.mvc.controller.Action; 15 import com.inversoft.verge.mvc.controller.form.config.FormConfig; 16 import com.inversoft.verge.util.RequestContext; 17 import com.inversoft.verge.util.WebBean; 18 19 20 32 public class FormAction extends Action { 33 34 private FormConfig formConfig; 35 36 37 40 public FormAction(FormConfig formConfig, String action, 41 HttpServletRequest request, HttpServletResponse response, 42 RequestContext requestContext) { 43 super(action, request, response, requestContext); 44 this.formConfig = formConfig; 45 } 46 47 50 public FormAction(String action, HttpServletRequest request, 51 HttpServletResponse response, RequestContext requestContext) { 52 super(action, request, response, requestContext); 53 } 54 55 56 63 public FormConfig getFormConfig() { 64 return formConfig; 65 } 66 67 77 public Object getFormBean(String name) throws BeanException { 78 WebBean wb = getFormConfig().getFormBean(name); 79 return (wb == null) ? null : wb.getInstance(getHttpServletRequest()); 80 } 81 } | Popular Tags |