1 7 package com.inversoft.verge.mvc.view.jsp.model; 8 9 10 import javax.servlet.jsp.JspException ; 11 12 import com.inversoft.verge.mvc.model.ModelResolution; 13 import com.inversoft.verge.mvc.view.jsp.html.ATag; 14 import com.inversoft.verge.mvc.view.jsp.html.BaseModelTag; 15 16 17 25 public class ParamTag extends BaseModelTag { 26 27 protected ModelResolution modelResolution; 28 29 30 35 public void initialize() throws JspException { 36 37 super.initialize(); 39 super.initializeKeyProperty(); 40 41 modelResolution = ModelHelper.getModelResolution(key, property, pageContext); 42 if (modelResolution == null) { 43 throw new JspException ("Invalid model definition: " + getModel()); 44 } 45 } 46 47 50 public int doStartTag() throws JspException { 51 initialize(); 52 53 return SKIP_BODY; 54 } 55 56 60 public int doEndTag() throws JspException { 61 super.doEndTag(); 62 63 ATag parent = (ATag) findAncestorWithClass(this, ATag.class); 64 if (parent == null) { 65 throw new JspException ("[ParamTag] - param tags must be used within" + 66 " anchor tags"); 67 } 68 69 ModelHelper.generateModelExtraParams(parent.getParameterMap(), 70 modelResolution.getMetaData(), localName, localValue); 71 72 return EVAL_PAGE; 73 } 74 } | Popular Tags |