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...@apache.org on 2001/07/14 16:19:53 UTC
cvs commit: jakarta-taglibs/application/src/org/apache/taglibs/application AttributeTag.java AttributesTEI.java AttributesTag.java EqualsAttributeTag.java EqualsInitParameterTag.java ExistsAttributeTag.java ExistsInitParameterTag.java InitParameterTag.java InitParametersTEI.java InitParametersTag.java RemoveAttributeTag.java SetAttributeTag.java
glenn 01/07/14 07:19:53
Modified: application/src/org/apache/taglibs/application
AttributeTag.java AttributesTEI.java
AttributesTag.java EqualsAttributeTag.java
EqualsInitParameterTag.java ExistsAttributeTag.java
ExistsInitParameterTag.java InitParameterTag.java
InitParametersTEI.java InitParametersTag.java
RemoveAttributeTag.java SetAttributeTag.java
Log:
Implement new tag design guidelines
Revision Changes Path
1.2 +3 -0 jakarta-taglibs/application/src/org/apache/taglibs/application/AttributeTag.java
Index: AttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AttributeTag.java 2000/12/20 13:18:43 1.1
+++ AttributeTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributeTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
1.2 +3 -0 jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTEI.java
Index: AttributesTEI.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTEI.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AttributesTEI.java 2000/12/20 13:18:43 1.1
+++ AttributesTEI.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTEI.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
1.2 +6 -10 jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTag.java
Index: AttributesTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AttributesTag.java 2000/12/20 13:18:43 1.1
+++ AttributesTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/AttributesTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -141,6 +144,7 @@
*/
public final int doEndTag() throws JspException
{
+ pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
try
{
if(bodyContent != null)
@@ -167,11 +171,11 @@
/**
* Returns the value of the attribute.
* <p>
- * <jsp:getProperty name=<i>"id"</i> property="attribute"/>
+ * <jsp:getProperty name=<i>"id"</i> property="value"/>
*
* @return String - value of the attribute
*/
- public final String getAttribute()
+ public final String getValue()
{
Object value = app.getAttribute(attribute);
if( value == null )
@@ -179,12 +183,4 @@
return "" + value.toString();
}
- /**
- * Remove the script variable after attributes tag closed out
- */
- public final void release()
- {
- if( id != null && id.length() > 0 )
- pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
- }
}
1.2 +40 -52 jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsAttributeTag.java
Index: EqualsAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EqualsAttributeTag.java 2000/12/20 13:18:43 1.1
+++ EqualsAttributeTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsAttributeTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,24 +68,24 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>equalsattribute</b>, used to determine if a ServletContext
+ * JSP Tag <b>equalsAttribute</b>, used to determine if a ServletContext
* attribute equals the value of the "match" tag attribute.
* <p>
* Includes the body of the tag if the attribute equals the value of the
* "match" tag attribute.
* <p>
* You can set the optional tag attribute <b>value</b> to <i>true</i> or
- * <i>false</i>. The body of the tag is included if equalsattribute matches
+ * <i>false</i>. The body of the tag is included if equalsAttribute matches
* the value.
* <p>
- * You can set the optional tag attribute <b>ignorecase</b> to <i>true</i> or
- * <i>false</i>. If ignorecase is set to true, then the comparison between the
+ * You can set the optional tag attribute <b>ignoreCase</b> to <i>true</i> or
+ * <i>false</i>. If ignoreCase is set to true, then the comparison between the
* application attribute and the "match" tag attribute will <i>not</i> be
* case-sensitive.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>equalsattribute</name>
+ * <name>equalsAttribute</name>
* <tagclass>org.apache.taglibs.application.EqualsAttributeTag</tagclass>
* <bodycontent>JSP</bodycontent>
* <info>Includes the body of the tag if the application attribute equals the
@@ -103,7 +106,7 @@
* <rtexprvalue>true</rtexprvalue>
* </attribute>
* <attribute>
- * <name>ignorecase</name>
+ * <name>ignoreCase</name>
* <required>false</required>
* <rtexprvalue>false</rtexprvalue>
* </attribute>
@@ -118,47 +121,38 @@
private String match = null;
//default behaviour is don't ignore case and execute body when tag contents
//equal value set by setMatch
- private Boolean ignorecase = new Boolean("false");
- private Boolean value = new Boolean("true");
+ private boolean ignoreCase = false;
+ private boolean value = true;
/**
* Includes the body of the tag if the application attribute equals the value set in the
* 'match' attribute.
*
- * @return SKIP_BODY if equalsattribute body content does not equal the value of
+ * @return SKIP_BODY if equalsAttribute body content does not equal the value of
* the match attribute, EVAL_BODY_include if it does
*/
public final int doStartTag() throws JspException
{
- //result is whether or not tag contents equal the match attribute
- boolean result = false;
- Object attribute = pageContext.getServletContext().getAttribute(name);
+ //result is whether or not tag contents equal the match attribute
+ boolean result = false;
+ Object attribute = pageContext.getServletContext().getAttribute(name);
- if (attribute == null) {
- result = false;
- } else {
- String attributeValue = attribute.toString();
-
- if (ignorecase.booleanValue() == true) {
- result = attributeValue.equalsIgnoreCase(match);
+ if (attribute == null) {
+ result = false;
} else {
- result = attributeValue.equals(match);
+ String attributeValue = attribute.toString();
+
+ if (ignoreCase) {
+ result = attributeValue.equalsIgnoreCase(match);
+ } else {
+ result = attributeValue.equals(match);
+ }
}
- }
- if (result == true) {
- if (value.booleanValue() == true) {
- return EVAL_BODY_INCLUDE;
- } else {
- return SKIP_BODY;
- }
- } else {
- if (value.booleanValue() == false) {
- return EVAL_BODY_INCLUDE;
- } else {
- return SKIP_BODY;
- }
- }
+ if( value == result )
+ return EVAL_BODY_INCLUDE;
+
+ return SKIP_BODY;
}
@@ -178,38 +172,32 @@
*
* @param String value to match against the application attribute
*/
- public final void setMatch(String str) {
- match=str;
+ public final void setMatch(String str)
+ {
+ match=str;
}
/**
- * If ignorecase is set to true, then the comparison
+ * If ignoreCase is set to true, then the comparison
* between the "match" attribute and the
* application attribute will <i>not</i> be case sensitive
*
- * @param str true = ignore case<BR>false = case sensitive<BR>
- * default value = false
+ * @param boolean true = ignore case<BR>false = case sensitive<BR>
+ * default value = false
*/
- public final void setIgnorecase(String str) {
- ignorecase = new Boolean(str);
+ public final void setIgnoreCase(boolean value)
+ {
+ this.ignoreCase = value;
}
/**
* Set the optional tag attribute <b>value</b> to true or false.
*
- * @param String true or false
+ * @param boolean true or false
*/
- public final void setValue(String str)
+ public final void setValue(boolean value)
{
- value = new Boolean(str);
+ this.value = value;
}
- public void release() {
- name = null;
- match = null;
- //default behaviour is don't ignore case and execute body when tag contents
- //equal value set by setMatch
- ignorecase = new Boolean("false");
- value = new Boolean("true");
- }
}
1.2 +35 -49 jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsInitParameterTag.java
Index: EqualsInitParameterTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsInitParameterTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EqualsInitParameterTag.java 2000/12/20 13:18:43 1.1
+++ EqualsInitParameterTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/EqualsInitParameterTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,24 +68,24 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>equalsinitparameter</b>, used to determine if an init parameter
+ * JSP Tag <b>equalsInitParameter</b>, used to determine if an init parameter
* equals the value of the "match" tag attribute.
* <p>
* Includes the body of the tag if the init parameter equals the value of the
* "match" tag attribute.
* <p>
* You can set the optional tag attribute <b>value</b> to <i>true</i> or
- * <i>false</i>. The body of the tag is included if equalsinitparameter matches
+ * <i>false</i>. The body of the tag is included if equalsInitParameter matches
* the value.
* <p>
- * You can set the optional tag attribute <b>ignorecase</b> to <i>true</i> or
- * <i>false</i>. If ignorecase is set to true, then the comparison between the
+ * You can set the optional tag attribute <b>ignoreCase</b> to <i>true</i> or
+ * <i>false</i>. If ignoreCase is set to true, then the comparison between the
* init parameter and the "match" tag attribute will <i>not</i> be
* case-sensitive.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>equalsinitparameter</name>;
+ * <name>equalsInitParameter</name>;
* <tagclass>org.apache.taglibs.application.EqualsInitParamaeterTag</tagclass>
* <bodycontent>JSP</bodycontent>
* <info>Includes the body of the tag if the init parameter equals the
@@ -103,7 +106,7 @@
* <rtexprvalue>true</rtexprvalue>
* </attribute>
* <attribute>
- * <name>ignorecase</name>
+ * <name>ignoreCase</name>
* <required>false</required>
* <rtexprvalue>false</rtexprvalue>
* </attribute>
@@ -118,45 +121,35 @@
private String match = null;
//default behaviour is don't ignore case and execute body when tag contents
//equal value set by setMatch
- private Boolean ignorecase = new Boolean("false");
- private Boolean value = new Boolean("true");
+ private boolean ignoreCase = false;
+ private boolean value = true;
/**
* Includes the body of the tag if the init parameter equals the value set in the
* 'match' attribute.
*
- * @return SKIP_BODY if equalsinitparameter doesn't match value, EVAL_BODY_include if equalsinitparameter matches value
+ * @return SKIP_BODY if equalsInitParameter doesn't match value, EVAL_BODY_include if equalsInitParameter matches value
*/
public final int doStartTag() throws JspException
{
- //result is whether or not tag contents equal the match attribute
- boolean result = false;
- String initParam = pageContext.getServletContext().getInitParameter(name);
+ //result is whether or not tag contents equal the match attribute
+ boolean result = false;
+ String initParam = pageContext.getServletContext().getInitParameter(name);
- if (initParam == null) {
- result = false;
- } else {
- if (ignorecase.booleanValue() == true) {
- result = initParam.equalsIgnoreCase(match);
+ if (initParam == null) {
+ result = false;
} else {
- result = initParam.equals(match);
+ if (ignoreCase) {
+ result = initParam.equalsIgnoreCase(match);
+ } else {
+ result = initParam.equals(match);
+ }
}
- }
- if (result == true) {
- if (value.booleanValue() == true) {
- return EVAL_BODY_INCLUDE;
- } else {
- return SKIP_BODY;
- }
- } else {
- if (value.booleanValue() == false) {
- return EVAL_BODY_INCLUDE;
- } else {
- return SKIP_BODY;
- }
- }
-
+ if( value == result )
+ return EVAL_BODY_INCLUDE;
+
+ return SKIP_BODY;
}
/**
@@ -180,33 +173,26 @@
}
/**
- * If ignorecase is set to true, then the comparison
+ * If ignoreCase is set to true, then the comparison
* between the "match" attribute and the
* init parameter will <i>not</i> be case sensitive
*
- * @param str true = ignore case<BR>false = case sensitive<BR>
- * default value = false
+ * @param boolean true = ignore case<BR>false = case sensitive<BR>
+ * default value = false
*/
- public final void setIgnorecase(String str) {
- ignorecase = new Boolean(str);
+ public final void setIgnoreCase(boolean value)
+ {
+ ignoreCase = value;
}
/**
* Set the optional tag attribute <b>value</b> to true or false.
*
- * @param String true or false
+ * @param boolean true or false
*/
- public final void setValue(String str)
+ public final void setValue(boolean value)
{
- value = new Boolean(str);
+ this.value = value;
}
- public void release() {
- name = null;
- match = null;
- //default behaviour is don't ignore case and execute body when tag contents
- //equal value set by setMatch
- ignorecase = new Boolean("false");
- value = new Boolean("true");
- }
}
1.2 +13 -14 jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsAttributeTag.java
Index: ExistsAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExistsAttributeTag.java 2000/12/20 13:18:43 1.1
+++ ExistsAttributeTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsAttributeTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,18 +68,18 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>existsattribute</b>, used to determine if a ServletContext
+ * JSP Tag <b>existsAttribute</b>, used to determine if a ServletContext
* attribute exists.
* <p>
* Includes the body of the tag if the attribute exists.
* <p>
* You can set the optional tag attribute <b>value</b> to <i>true</i> or
- * <i>false</i>. The body of the tag is included if existsattribute matches
+ * <i>false</i>. The body of the tag is included if existsAttribute matches
* the value.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>existsattribute</name>
+ * <name>existsAttribute</name>
* <tagclass>org.apache.taglibs.application.ExistsAttributeTag</tagclass>
* <bodycontent>JSP</bodycontent>
* <info>Includes the body of the tag if the application attribute exists.</info>
@@ -98,12 +101,12 @@
public class ExistsAttributeTag extends TagSupport
{
private String name = null;
- private Boolean value = null;
+ private boolean value = true;
/**
* Includes the body of the tag if the application attribute exists.
*
- * @return SKIP_BODY if existsattribute doesn't match value, EVAL_BODY_include if existsattribute matches value
+ * @return SKIP_BODY if existsAttribute doesn't match value, EVAL_BODY_include if existsAttribute matches value
*/
public final int doStartTag() throws JspException
{
@@ -111,13 +114,9 @@
if( pageContext.getServletContext().getAttribute(name) != null )
result = true;
- if( value == null ) {
- if( result )
- return EVAL_BODY_INCLUDE;
- return SKIP_BODY;
- }
- if( value.booleanValue() == result )
+ if( value == result )
return EVAL_BODY_INCLUDE;
+
return SKIP_BODY;
}
@@ -134,11 +133,11 @@
/**
* Set the optional tag attribute <b>value</b> to true or false.
*
- * @param String true or false
+ * @param boolean true or false
*/
- public final void setValue(String str)
+ public final void setValue(boolean value)
{
- value = new Boolean(str);
+ this.value = value;
}
}
1.2 +10 -11 jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsInitParameterTag.java
Index: ExistsInitParameterTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsInitParameterTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExistsInitParameterTag.java 2000/12/20 13:18:43 1.1
+++ ExistsInitParameterTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/ExistsInitParameterTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -76,7 +79,7 @@
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>existsinitparameter</name>
+ * <name>existsInitParameter</name>
* <tagclass>org.apache.taglibs.application.ExistsInitParameterTag</tagclass>
* <bodycontent>JSP</bodycontent>
* <info>Includes the body of the tag if the init parameter exists.</info>
@@ -98,7 +101,7 @@
public class ExistsInitParameterTag extends TagSupport
{
private String name = null;
- private Boolean value = null;
+ private boolean value = true;
/**
* Includes the body of the tag if the init parameter exists.
@@ -111,13 +114,9 @@
if( pageContext.getServletContext().getInitParameter(name) != null )
result = true;
- if( value == null ) {
- if( result )
- return EVAL_BODY_INCLUDE;
- return SKIP_BODY;
- }
- if( value.booleanValue() == result )
+ if( value == result )
return EVAL_BODY_INCLUDE;
+
return SKIP_BODY;
}
@@ -134,11 +133,11 @@
/**
* Set the optional tag attribute <b>value</b> to true or false.
*
- * @param String true or false
+ * @param boolean true or false
*/
- public final void setValue(String str)
+ public final void setValue(boolean value)
{
- value = new Boolean(str);
+ this.value = value;
}
}
1.2 +5 -2 jakarta-taglibs/application/src/org/apache/taglibs/application/InitParameterTag.java
Index: InitParameterTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParameterTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitParameterTag.java 2000/12/20 13:18:43 1.1
+++ InitParameterTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParameterTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,12 +68,12 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>initparameter</b>, used to output the value for a single
+ * JSP Tag <b>initParameter</b>, used to output the value for a single
* init parameter named with <b>name</b>.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>initparameter</name>
+ * <name>initParameter</name>
* <tagclass>org.apache.taglibs.application.InitParameterTag</tagclass>
* <bodycontent>empty</bodycontent>
* <info>Output the value of a single init parameter.</info>
1.2 +3 -0 jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTEI.java
Index: InitParametersTEI.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTEI.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitParametersTEI.java 2000/12/20 13:18:43 1.1
+++ InitParametersTEI.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTEI.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
1.2 +11 -15 jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTag.java
Index: InitParametersTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- InitParametersTag.java 2000/12/20 13:18:43 1.1
+++ InitParametersTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/InitParametersTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,21 +68,21 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>initparameters</b>, used to get init parameters
+ * JSP Tag <b>initParameters</b>, used to get init parameters
* information using the standard JSP 1.2 <jsp:getProperty> tag.
* <p>
* The script variable of name <b>id</b> is availble only within the
- * body of the <b>initparameters</b> tag.
+ * body of the <b>initParameters</b> tag.
* <p>
* Loops through all the init parameters in the ServletContext.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>initparameters</name>
+ * <name>initParameters</name>
* <tagclass>org.apache.taglibs.application.InitParametersTag</tagclass>
* <teiclass>org.apache.taglibs.application.InitParametersTEI</teiclass>
* <bodycontent>JSP</bodycontent>
- * <info>Loop through all initparameters or get a single initparameter.</info>
+ * <info>Loop through all initParameters or get a single initParameter.</info>
* <attribute>
* <name>id</name>
* <required>true</required>
@@ -119,7 +122,7 @@
}
/**
- * Method called at end of each initparmaeters tag.
+ * Method called at end of each initParmaeters tag.
*
* @return EVAL_BODY_TAG if there is another init parameter, or SKIP_BODY if there are no more init parameters
*/
@@ -142,6 +145,7 @@
*/
public final int doEndTag() throws JspException
{
+ pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
try
{
if(bodyContent != null)
@@ -168,11 +172,11 @@
/**
* Returns the value of the init parameter.
* <p>
- * <jsp:getProperty name=<i>"id"</i> property="parameter"/>
+ * <jsp:getProperty name=<i>"id"</i> property="value"/>
*
* @return String - value of the init parameter
*/
- public final String getParameter()
+ public final String getValue()
{
String paramValue = app.getInitParameter(paramName);
if (paramValue == null) {
@@ -182,12 +186,4 @@
return paramValue;
}
- /**
- * Remove the script variable after attributes tag closed out
- */
- public final void release()
- {
- if( id != null && id.length() > 0 )
- pageContext.removeAttribute(id,PageContext.PAGE_SCOPE);
- }
}
1.2 +5 -2 jakarta-taglibs/application/src/org/apache/taglibs/application/RemoveAttributeTag.java
Index: RemoveAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/RemoveAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RemoveAttributeTag.java 2000/12/20 13:18:44 1.1
+++ RemoveAttributeTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/RemoveAttributeTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,12 +68,12 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>removeattribute</b>, used to remove a ServletContext
+ * JSP Tag <b>removeAttribute</b>, used to remove a ServletContext
* attribute with name <b>name</b>.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>removeattribute</name>
+ * <name>removeAttribute</name>
* <tagclass>org.apache.taglibs.application.RemoveAttributeTag</tagclass>
* <bodycontent>empty</bodycontent>
* <info>Removes an attribute from the ServletContext.</info>
1.2 +6 -3 jakarta-taglibs/application/src/org/apache/taglibs/application/SetAttributeTag.java
Index: SetAttributeTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/SetAttributeTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SetAttributeTag.java 2000/12/20 13:18:44 1.1
+++ SetAttributeTag.java 2001/07/14 14:19:52 1.2
@@ -1,4 +1,7 @@
/*
+ * $Header: /home/cvs/jakarta-taglibs/application/src/org/apache/taglibs/application/SetAttributeTag.java,v 1.2 2001/07/14 14:19:52 glenn Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/07/14 14:19:52 $
*
* ====================================================================
*
@@ -65,12 +68,12 @@
import javax.servlet.jsp.tagext.*;
/**
- * JSP Tag <b>setattribute</b>, used to set a ServletContext
+ * JSP Tag <b>setAttribute</b>, used to set a ServletContext
* attribute with name <b>name</b> to a String from the body of the tag.
* <p>
* JSP Tag Lib Descriptor
* <p><pre>
- * <name>setattribute</name>
+ * <name>setAttribute</name>
* <tagclass>org.apache.taglibs.application.SetAttributeTag</tagclass>
* <bodycontent>JSP</bodycontent>
* <info>Sets an attribute from the ServletContext.</info>
@@ -99,7 +102,7 @@
}
/**
- * Read the body of the setattribute tag to obtain the attribute value,
+ * Read the body of the setAttribute tag to obtain the attribute value,
* then set the attribute with <b>name</b> to that value.
*
* @return SKIP_BODY