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 44 45 public class ParameterTag extends TagSupport 46 { 47 private String name = null; 49 50 55 public final int doEndTag() throws JspException 56 { 57 String value = 58 ((HttpServletRequest)pageContext.getRequest()).getParameter(name); 59 if( value == null ) 60 value = ""; 61 62 try { 63 pageContext.getOut().write("" + value); 64 } catch(Exception e) { 65 throw new JspException("IO Error: " + e.getMessage()); 66 } 67 68 return EVAL_PAGE; 69 } 70 71 76 public final void setName(String str) 77 { 78 name = str; 79 } 80 81 } 82 | Popular Tags |