You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by gl...@locus.apache.org on 2000/11/03 13:52:09 UTC

cvs commit: jakarta-taglibs/request/src/org/apache/taglibs/request ParametersTag.java

glenn       00/11/03 04:52:09

  Modified:    request/src/org/apache/taglibs/request ParametersTag.java
  Log:
  Cleanup for release
  
  Revision  Changes    Path
  1.2       +22 -14    jakarta-taglibs/request/src/org/apache/taglibs/request/ParametersTag.java
  
  Index: ParametersTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ParametersTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParametersTag.java	2000/09/21 14:14:35	1.1
  +++ ParametersTag.java	2000/11/03 12:52:07	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ParametersTag.java,v 1.1 2000/09/21 14:14:35 glenn Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/09/21 14:14:35 $
  + * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/ParametersTag.java,v 1.2 2000/11/03 12:52:07 glenn Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/11/03 12:52:07 $
    *
    * ====================================================================
    *
  @@ -103,9 +103,12 @@
   
   public class ParametersTag extends BodyTagSupport
   {
  +    // Optional attribute, HTTP input parameter name
       private String name = null;
       private HttpServletRequest req = null;
  +    // All the parameter names
       private Enumeration parameters = null;
  +    // Name of current parameter
       private String parameter = null;
   
       /**
  @@ -113,7 +116,7 @@
        *
        * @return SKIP_BODY if no parameters or parameter with <b>name</b> is not found, EVAL_BODY_TAG if parameter exists
        */
  -    public int doStartTag() throws JspException
  +    public final int doStartTag() throws JspException
       {
   	// Get the request
   	req = (HttpServletRequest)pageContext.getRequest();
  @@ -139,7 +142,7 @@
        *
        * @return EVAL_BODY_TAG if there is another parameter, or SKIP_BODY if there are no more parameters or this is a named parameter
        */
  -    public int doAfterBody() throws JspException
  +    public final int doAfterBody() throws JspException
       {
   	// See if this is the last or a named parameter
   	if( name != null || !parameters.hasMoreElements() )
  @@ -155,7 +158,7 @@
        * Method called at end of Tag
        * @return EVAL_PAGE
        */
  -    public int doEndTag() throws JspException
  +    public final int doEndTag() throws JspException
       {
   	try
   	{
  @@ -168,7 +171,12 @@
   	return EVAL_PAGE;
       }
   
  -    public void setName(String str)
  +    /**
  +     * Set the optional tag attribute <b>name</b>.
  +     *
  +     * @param String name of HTTP input parameter
  +     */
  +    public final void setName(String str)
       {
   	name = str;
       }
  @@ -178,9 +186,9 @@
        * <p>
        * &lt;jsp:getProperty name=<i>"id"</i> property="name"/&gt;
        *
  -     * @return the parameter name as a String
  +     * @return String - parameter name
        */
  -    public String getName()
  +    public final String getName()
       {
   	return parameter;
       }
  @@ -188,11 +196,11 @@
       /**
        * Returns the value of the parameter.
        * <p>
  -     * &lt;jsp:getProperty name=<i>"id"</i> property="parameter"/&gt;
  +     * &lt;jsp:getProperty name=<i>"id"</i> property="value"/&gt;
        *
  -     * @return the value of the parameter as a String
  +     * @return String - value of the parameter
        */
  -    public String getParameter()
  +    public final String getValue()
       {
   	String value = req.getParameter(parameter);
   	if( value == null )
  @@ -203,9 +211,9 @@
       /**
        * Remove the script variable after parameters tag closed out
        */
  -    public void release()
  +    public final void release()
       {
  -	if( id.length() > 0 )
  +	if( id != null && id.length() > 0 )
   	    pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
       }
   }