1 7 package com.inversoft.verge.mvc.model.actionflow; 8 9 10 import java.util.Map ; 11 12 import javax.servlet.http.HttpServletRequest ; 13 14 import com.inversoft.beans.BeanException; 15 import com.inversoft.verge.mvc.MVCException; 16 import com.inversoft.verge.mvc.MVCRequest; 17 import com.inversoft.verge.mvc.config.BaseFormConfig; 18 import com.inversoft.verge.mvc.controller.actionflow.config.ActionFlowConfigStruct; 19 import com.inversoft.verge.mvc.model.ModelResolution; 20 import com.inversoft.verge.mvc.model.ModelResolver; 21 import com.inversoft.verge.util.WebBean; 22 23 24 35 public class ActionFlowModelResolver implements ModelResolver { 36 37 40 public ActionFlowModelResolver() { 41 super(); 42 } 43 44 45 57 public ModelResolution resolve(MVCRequest mvcRequest, String definition, 58 Map extraParams) 59 throws MVCException { 60 61 HttpServletRequest request = mvcRequest.getRequest(); 64 ActionFlowConfigStruct struct = (ActionFlowConfigStruct) mvcRequest.getConfiguration(); 65 BaseFormConfig config = struct.baseFormConfig; 66 ActionFlowModelMetaData md = new ActionFlowModelMetaData(definition); 67 WebBean formBean = config.getFormBean(md.getID()); 68 ModelResolution mr = null; 69 70 try { 71 mr = new ModelResolution(formBean.getInstance(request), md); 72 } catch (BeanException be) { 73 throw new MVCException(be); 74 } 75 76 return mr; 77 } 78 } | Popular Tags |