org.apache.taglibs.request
Class QueryStringsTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.request.QueryStringsTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class QueryStringsTag
extends javax.servlet.jsp.tagext.BodyTagSupport

JSP Tag querystrings, used to get HttpServletRequest querystring parameters using the standard JSP <jsp:getProperty> tag.

The script variable of name id is availble only within the body of the querystrings tag.

Loops through all the querystring parameters received by the HttpServletRequest.

If the optional attribute name is present only the querystring parameter of that name is retreived.

JSP Tag Lib Descriptor

 <name>querystrings</name>
 <tagclass>org.apache.taglibs.request.QueryStringsTag</tagclass>
 <teiclass>org.apache.taglibs.request.QueryStringsTEI</teiclass>
 <bodycontent>JSP</bodycontent>
 <info>Used to loop through all querystring parameters or get a single querystring parameter.</info>
   <attribute>
     <name>id</name>
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
   <attribute>
     <name>name</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
 

Author:
Glenn Nielsen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
QueryStringsTag()
           
 
Method Summary
 int doAfterBody()
          Method called at end of each querystrings tag.
 int doEndTag()
          Method called at end of Tag
 int doStartTag()
          Gets the querystring parameters that came with the request or querystring parameter with name.
 java.lang.String getName()
          Returns the name of the querystring parameter.
 java.lang.String getQueryString()
          Returns the entire querystring parameter/value.
 java.lang.String getValue()
          Returns the value of the querystring parameter.
 void setName(java.lang.String str)
          Set the optional tag attribute name.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

QueryStringsTag

public QueryStringsTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Gets the querystring parameters that came with the request or querystring parameter with name.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY if no querystring or querystring parameter with name is not found, EVAL_BODY_TAG if querystring parameter exists
Throws:
javax.servlet.jsp.JspException

doAfterBody

public final int doAfterBody()
                      throws javax.servlet.jsp.JspException
Method called at end of each querystrings tag.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG if there is another querystring, or SKIP_BODY if there are no more querystrings or this is a named querystring
Throws:
javax.servlet.jsp.JspException

doEndTag

public final int doEndTag()
                   throws javax.servlet.jsp.JspException
Method called at end of Tag

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException

setName

public final void setName(java.lang.String str)
Set the optional tag attribute name.

Parameters:
String - name of input parameter in querystring

getName

public final java.lang.String getName()
Returns the name of the querystring parameter.

<jsp:getProperty name="id" property="name"/>

Returns:
String - querystring parameter name as a String

getValue

public final java.lang.String getValue()
Returns the value of the querystring parameter.

<jsp:getProperty name="id" property="value"/>

Returns:
String - value of the querystring parameter as a String

getQueryString

public final java.lang.String getQueryString()
Returns the entire querystring parameter/value.

<jsp:getProperty name="id" property="queryString"/>

Returns:
String - entire querystring parameter/value as a String


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.