1 7 package com.inversoft.verge.mvc.model.web; 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.model.ModelResolution; 18 import com.inversoft.verge.mvc.model.ModelResolver; 19 import com.inversoft.verge.util.WebBean; 20 21 22 34 public class WebModelResolver implements ModelResolver { 35 36 39 public WebModelResolver() { 40 super(); 41 } 42 43 44 59 public ModelResolution resolve(MVCRequest mvcRequest, String definition, 60 Map extraParams) 61 throws MVCException { 62 HttpServletRequest request = mvcRequest.getRequest(); 63 WebMetaData md = new WebMetaData(definition, extraParams); 64 65 try { 66 WebBean wb = md.createWebBean(); 67 return new ModelResolution(wb.getInstance(request), md); 68 } catch (BeanException be) { 69 throw new MVCException(be); 70 } 71 } 72 } | Popular Tags |