1 16 17 package org.apache.taglibs.request; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 55 56 public class ExistsParameterTag extends TagSupport 57 { 58 private String name = null; 60 private boolean value = true; 61 62 67 public final int doStartTag() throws JspException 68 { 69 boolean result = false; 70 String tmp = ((HttpServletRequest)pageContext.getRequest()).getParameter(name); 71 if( tmp != null && tmp.length() > 0 ) 72 result = true; 73 74 if( value == result ) 75 return EVAL_BODY_INCLUDE; 76 77 return SKIP_BODY; 78 } 79 80 85 public final void setName(String str) 86 { 87 name = str; 88 } 89 90 95 public final void setValue(boolean value) 96 { 97 this.value = value; 98 } 99 100 } 101 | Popular Tags |