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:49:51 UTC
cvs commit: jakarta-taglibs/request/src/org/apache/taglibs/request HeaderValuesTag.java
glenn 00/11/03 04:49:51
Modified: request/src/org/apache/taglibs/request HeaderValuesTag.java
Log:
Cleanup for release
Revision Changes Path
1.2 +17 -11 jakarta-taglibs/request/src/org/apache/taglibs/request/HeaderValuesTag.java
Index: HeaderValuesTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/HeaderValuesTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HeaderValuesTag.java 2000/09/21 14:14:34 1.1
+++ HeaderValuesTag.java 2000/11/03 12:49:50 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/HeaderValuesTag.java,v 1.1 2000/09/21 14:14:34 glenn Exp $
- * $Revision: 1.1 $
- * $Date: 2000/09/21 14:14:34 $
+ * $Header: /home/cvs/jakarta-taglibs/request/src/org/apache/taglibs/request/HeaderValuesTag.java,v 1.2 2000/11/03 12:49:50 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/11/03 12:49:50 $
*
* ====================================================================
*
@@ -85,7 +85,7 @@
* <tagclass>org.apache.taglibs.request.HeaderValuesTag</tagclass>
* <teiclass>org.apache.taglibs.request.HeaderValuesTEI</teiclass>
* <bodycontent>JSP</bodycontent>
- * <info>Used to loop through all headers or get a single header.</info>
+ * <info>Loop through all the values for a header which has multiple values.</info>
* <attribute>
* <name>id</name>
* <required>true</required>
@@ -93,13 +93,18 @@
* </attribute>
* </pre>
*
+ * @see HeadersTag
+ *
* @author Glenn Nielsen
*/
public class HeaderValuesTag extends BodyTagSupport
{
+ // All the values for header
private Enumeration values = null;
+ // Current value
private String value = null;
+ // Name of HTTP header
private String header = null;
/**
@@ -107,7 +112,7 @@
*
* @return SKIP_BODY if no header values exist, EVAL_BODY_TAG if header values exist
*/
- public int doStartTag() throws JspException
+ public final int doStartTag() throws JspException
{
// Get the parent headers tag
HeadersTag ht;
@@ -139,7 +144,7 @@
*
* @return EVAL_BODY_TAG if there is another header value, or SKIP_BODY if there are no more header values
*/
- public int doAfterBody() throws JspException
+ public final int doAfterBody() throws JspException
{
// See if this is the last header value
if( !values.hasMoreElements() )
@@ -153,9 +158,10 @@
/**
* Method called at end of Tag
+ *
* @return EVAL_PAGE
*/
- public int doEndTag() throws JspException
+ public final int doEndTag() throws JspException
{
try
{
@@ -173,9 +179,9 @@
* <p>
* <jsp:getProperty name=<i>"id"</i> property="header"/>
*
- * @return the value of the header as a String
+ * @return String - value of the header
*/
- public String getHeader()
+ public final String getHeader()
{
return value;
}
@@ -183,9 +189,9 @@
/**
* Remove the script variable after headervalues 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);
}
}