1 48 49 50 package com.caucho.portal.generic.taglib; 51 52 import javax.servlet.jsp.JspException ; 53 import javax.servlet.jsp.tagext.TagSupport ; 54 55 58 public class ParamTag extends TagSupport { 59 private String _name; 60 private String _value; 61 private String _namespace; 62 63 66 public void setName(String name) 67 { 68 _name = name; 69 } 70 71 74 public void setValue(String value) 75 { 76 _value = value; 77 } 78 79 82 public void setNamespace(String namespace) 83 { 84 _namespace = namespace; 85 } 86 87 90 public int doEndTag() 91 throws JspException 92 { 93 Object parent = getParent(); 94 95 if (! (parent instanceof AbstractUrlTag)) 96 throw new JspException ("portlet:param requires portlet:renderUrl or portlet:actionUrl parent."); 97 98 AbstractUrlTag urlTag = (AbstractUrlTag) parent; 99 100 if (_namespace == null) { 101 urlTag.addParam(_name, _value); 102 } 103 else { 104 urlTag.addParam(_namespace, _name, _value); 105 } 106 107 return EVAL_PAGE; 108 } 109 } 110 | Popular Tags |