jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kar...@apache.org
Subject svn commit: r531153 - in /jakarta/taglibs/proper/input/trunk: examples/web/ src/org/apache/taglibs/input/ xml/ xml/attributes/
Date Sun, 22 Apr 2007 08:00:16 GMT
Author: karlvr
Date: Sun Apr 22 01:00:15 2007
New Revision: 531153

URL: http://svn.apache.org/viewvc?view=rev&rev=531153
Log:
bug #29652 Implement value/selectedValue(s)/checkedValue(s) to all tags to force a value
Reorganised input.xml file into more fragments to make documentation more consistent

Added:
    jakarta/taglibs/proper/input/trunk/examples/web/value.jsp
    jakarta/taglibs/proper/input/trunk/xml/attributes/
    jakarta/taglibs/proper/input/trunk/xml/attributes/bean.xml
    jakarta/taglibs/proper/input/trunk/xml/attributes/checkedvalue.xml
    jakarta/taglibs/proper/input/trunk/xml/attributes/default.xml
    jakarta/taglibs/proper/input/trunk/xml/attributes/name.xml
    jakarta/taglibs/proper/input/trunk/xml/attributes/value.xml
Modified:
    jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/BaseInputTag.java
    jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Checkbox.java
    jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Radio.java
    jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Select.java
    jakarta/taglibs/proper/input/trunk/xml/input.xml

Added: jakarta/taglibs/proper/input/trunk/examples/web/value.jsp
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/examples/web/value.jsp?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/examples/web/value.jsp (added)
+++ jakarta/taglibs/proper/input/trunk/examples/web/value.jsp Sun Apr 22 01:00:15 2007
@@ -0,0 +1,99 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<!--
+  Copyright (c) 2000 The Apache Software Foundation.  All rights reserved.
+  Author: Karl von Randow (karl@xk72.com)
+
+  Demonstrates the new "value" attribute
+
+-->
+<body bgcolor="#eeeeee">
+<%@ taglib uri="http://jakarta.apache.org/taglibs/input-1.2" prefix="input" %>
+
+<p>
+Previously you had to set the value of a form element using the "default" attribute,
+which meant that a matching request parameter would override it.
+As of version 1.2 there is a "value" attribute on most input tags that lets you
+specify the actual value to use.
+</p>
+
+<input:form>
+<p>
+With value:<br />
+<input:text name="textValue" value="Value" /><br />
+With default value:<br />
+<input:text name="textDefault" default="Default" /><br />
+<br />
+
+
+With selectedValue:<br />
+<input:select name="selectValue" selectedValue="2">
+	<input:option value="1">one</input:option>
+	<input:option value="2">two</input:option>
+	<input:option value="3">three</input:option>
+</input:select><br />
+With default:<br />
+<input:select name="selectDefault" default="2">
+	<input:option value="1">one</input:option>
+	<input:option value="2">two</input:option>
+	<input:option value="3">three</input:option>
+</input:select><br />
+With multiple selectedValues:<br />
+<% 
+String[] selectedValues = new String[2];
+selectedValues[0] = "1";
+selectedValues[1] = "2";
+%>
+<input:select name="selectValues" size="3" multiple="true" selectedValues="<%=selectedValues
%>">
+	<input:option value="1">one</input:option>
+	<input:option value="2">two</input:option>
+	<input:option value="3">three</input:option>
+</input:select>
+
+<br />
+<br />
+
+With checkedValue:
+<input:radio name="radioValue" value="a" checkedValue="a"/>a 
+<input:radio name="radioValue" value="b" checkedValue="a"/>b
+<input:radio name="radioValue" value="c" checkedValue="a"/>c
+<input:radio name="radioValue" value="d" checkedValue="a"/>d
+<br />
+
+With default:
+<input:radio name="radioDefault" value="a" default="a"/>a 
+<input:radio name="radioDefault" value="b" default="a"/>b
+<input:radio name="radioDefault" value="c" default="a"/>c
+<input:radio name="radioDefault" value="d" default="a"/>d
+
+<br />
+<br />
+
+<% 
+String[] defaults = new String[2];
+defaults[0] = "2";
+defaults[1] = "5";
+%>
+
+With checkedValues:
+<input:checkbox name="checkboxValue" value="1" checkedValues="<%= defaults %>"/>1
+<input:checkbox name="checkboxValue" value="2" checkedValues="<%= defaults %>"/>2
+<input:checkbox name="checkboxValue" value="3" checkedValues="<%= defaults %>"/>3
+<input:checkbox name="checkboxValue" value="4" checkedValues="<%= defaults %>"/>4
+<input:checkbox name="checkboxValue" value="5" checkedValues="<%= defaults %>"/>5
+<br />
+With default:
+<input:checkbox name="checkboxDefault" value="1" defaults="<%= defaults %>"/>1
+<input:checkbox name="checkboxDefault" value="2" defaults="<%= defaults %>"/>2
+<input:checkbox name="checkboxDefault" value="3" defaults="<%= defaults %>"/>3
+<input:checkbox name="checkboxDefault" value="4" defaults="<%= defaults %>"/>4
+<input:checkbox name="checkboxDefault" value="5" defaults="<%= defaults %>"/>5
+<br />
+<br />
+<input type="submit" />
+
+</p>
+</input:form>
+
+</body>
+</html>

Modified: jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/BaseInputTag.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/BaseInputTag.java?view=diff&rev=531153&r1=531152&r2=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/BaseInputTag.java (original)
+++ jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/BaseInputTag.java Sun
Apr 22 01:00:15 2007
@@ -17,6 +17,14 @@
 	private String defaultValue;
 	
 	private String[] defaultValueArray;
+	
+	private String value;
+	
+	private String[] valueArray;
+	
+	private boolean valueSpecified;
+	
+	private boolean valueArraySpecified;
 
 	/**
 	 * input / textarea common
@@ -30,9 +38,7 @@
 	 */
 	private String size, src, alt, usemap, accept;
 
-	private int maxlength;
-
-	private boolean maxlengthSupplied;
+	private Integer maxlength;
 
 	/**
 	 * Custom attributes
@@ -49,6 +55,10 @@
 		defaultValue = null;
 		defaultValueArray = null;
 		beanId = null;
+		value = null;
+		valueSpecified = false;
+		valueArray = null;
+		valueArraySpecified = false;
 
 		disabled = false;
 		readonly = false;
@@ -57,8 +67,7 @@
 		onchange = null;
 
 		size = null;
-		maxlength = 0;
-		maxlengthSupplied = false;
+		maxlength = null;
 		src = null;
 		alt = null;
 		usemap = null;
@@ -93,9 +102,7 @@
 		super.printAttributes(out);
 		
 		printAttribute(out, "size", size);
-		if (maxlengthSupplied) {
-			printAttribute(out, "maxlength", new Integer(maxlength));
-		}
+		printAttribute(out, "maxlength", maxlength);
 		printAttribute(out, "src", src);
 		printAttribute(out, "alt", alt);
 		printAttribute(out, "usemap", usemap);
@@ -137,6 +144,8 @@
 			if (beanId != null && beanId.length() > 0 && pageContext.findAttribute(beanId)
!= null) {
 				/* Use the property values from the bean if the bean exists */
 				return Util.beanPropertyValue(pageContext.findAttribute(beanId), name, index);
+			} else if (valueSpecified) {
+				return value;
 			} else if (request.getParameter(name) != null) {
 				String[] values = request.getParameterValues(name);
 				if (values != null && values.length > index) {
@@ -148,12 +157,11 @@
 				return findDefaultValue();
 			}
 		} else {
-			if (beanId != null && beanId.length() == 0) {
-				/* An empty beanId means use an imaginary empty bean */
-				return null;
-			} else if (beanId != null && pageContext.findAttribute(beanId) != null) {
+			if (beanId != null && beanId.length() > 0 && pageContext.findAttribute(beanId)
!= null) {
 				/* Use the property values from the bean */
 				return Util.beanPropertyValue(pageContext.findAttribute(beanId), name);
+			} else if (valueSpecified) {
+				return value;
 			} else if (request.getParameter(name) != null) {
 				return request.getParameter(name);
 			} else {
@@ -188,12 +196,18 @@
 		
 		ServletRequest request = pageContext.getRequest();
 		
-		if (beanId != null && beanId.length() == 0) {
-			/* An empty beanId means use an imaginary empty bean */
-			return null;
-		} else if (beanId != null && pageContext.findAttribute(beanId) != null) {
+		if (beanId != null && beanId.length() > 0 && pageContext.findAttribute(beanId)
!= null) {
 			/* Use the property values from the bean */
 			return Util.beanPropertyValues(pageContext.findAttribute(beanId), name);
+		} else if (valueArraySpecified && valueSpecified && valueArray != null)
{
+			String[] values = new String[valueArray.length + 1];
+			values[0] = value;
+			System.arraycopy(valueArray, 0, values, 1, valueArray.length);
+			return values;
+		} else if (valueArraySpecified) {
+			return valueArray;
+		} else if (valueSpecified) {
+			return new String[] { value };
 		} else if (request.getParameterValues(name) != null) {
 			return request.getParameterValues(name);
 		} else {
@@ -205,10 +219,10 @@
 		if (this instanceof BaseInputBodyTag && ((BaseInputBodyTag)this).getBodyContentString()
!= null) {
 			return new String[] { ((BaseInputBodyTag)this).getBodyContentString() };
 		} else if (defaultValueArray != null && defaultValue != null) {
-				String[] values = new String[defaultValueArray.length + 1];
-				values[0] = defaultValue;
-				System.arraycopy(defaultValueArray, 0, values, 1, defaultValueArray.length);
-				return values;
+			String[] values = new String[defaultValueArray.length + 1];
+			values[0] = defaultValue;
+			System.arraycopy(defaultValueArray, 0, values, 1, defaultValueArray.length);
+			return values;
 		} else if (defaultValueArray != null) {
 			return defaultValueArray;
 		} else if (defaultValue != null) {
@@ -268,6 +282,24 @@
 		}
 	}
 
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+		this.valueSpecified = true;
+	}
+
+	public String[] getValueArray() {
+		return valueArray;
+	}
+
+	public void setValueArray(String[] valueArray) {
+		this.valueArray = valueArray;
+		this.valueArraySpecified = true;
+	}
+
 	public Map getAttributes() {
 		return attributes;
 	}
@@ -333,12 +365,11 @@
 	}
 
 	public int getMaxlength() {
-		return maxlength;
+		return maxlength != null ? maxlength.intValue() : 0;
 	}
 
 	public void setMaxlength(int maxlength) {
-		this.maxlength = maxlength;
-		this.maxlengthSupplied = true;
+		this.maxlength = new Integer(maxlength);
 	}
 
 	public String getSize() {

Modified: jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Checkbox.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Checkbox.java?view=diff&rev=531153&r1=531152&r2=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Checkbox.java (original)
+++ jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Checkbox.java Sun Apr
22 01:00:15 2007
@@ -36,8 +36,13 @@
 
 	private static final String DEFAULT_VALUE = "on";
 	
+	/**
+	 * This value is the value that the checkbox submits if it is checked. Note that this
+	 * hides the "value" in BaseInputTag as that has a different purpose... that is for
+	 * specifying what value the tag should tag (ie. what state it is in).
+	 */
 	private String value;
-
+	
 	protected void init() {
 		super.init();
 		value = null;
@@ -104,6 +109,22 @@
 
 	public void setValue(String value) {
 		this.value = value;
+	}
+	
+	public String getCheckedValue() {
+		return super.getValue();
+	}
+	
+	public void setCheckedValue(String value) {
+		super.setValue(value);
+	}
+	
+	public String[] getCheckedValues() {
+		return super.getValueArray();
+	}
+	
+	public void setCheckedValues(String[] values) {
+		super.setValueArray(values);
 	}
 
 }

Modified: jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Radio.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Radio.java?view=diff&rev=531153&r1=531152&r2=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Radio.java (original)
+++ jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Radio.java Sun Apr 22
01:00:15 2007
@@ -34,7 +34,12 @@
 
 public class Radio extends BaseInputTag {
 
-	private String value; // value of this particular button
+	/**
+	 * This value is the value that the radio submits if it is checked. Note that this
+	 * hides the "value" in BaseInputTag as that has a different purpose... that is for
+	 * specifying what value the tag should tag (ie. what state it is in).
+	 */
+	private String value;
 
 	protected void init() {
 		super.init();
@@ -76,6 +81,14 @@
 
 	public void setValue(String value) {
 		this.value = value;
+	}
+	
+	public String getCheckedValue() {
+		return super.getValue();
+	}
+	
+	public void setCheckedValue(String value) {
+		super.setValue(value);
 	}
 
 }

Modified: jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Select.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Select.java?view=diff&rev=531153&r1=531152&r2=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Select.java (original)
+++ jakarta/taglibs/proper/input/trunk/src/org/apache/taglibs/input/Select.java Sun Apr 22
01:00:15 2007
@@ -220,5 +220,21 @@
 	public List getOptionValues() {
 		return optionValues;
 	}
+	
+	public String getSelectedValue() {
+		return getValue();
+	}
+	
+	public void setSelectedValue(String value) {
+		super.setValue(value);
+	}
+	
+	public String[] getSelectedValues() {
+		return getValueArray();
+	}
+	
+	public void setSelectedValues(String[] values) {
+		super.setValueArray(values);
+	}
 
 }

Added: jakarta/taglibs/proper/input/trunk/xml/attributes/bean.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/attributes/bean.xml?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/attributes/bean.xml (added)
+++ jakarta/taglibs/proper/input/trunk/xml/attributes/bean.xml Sun Apr 22 01:00:15 2007
@@ -0,0 +1,13 @@
+				<attribute>
+					<name>bean</name>
+					<required>false</required>
+					<rtexprvalue>true</rtexprvalue>
+					<description>
+						id of the bean to get the value for this tag from. If no bean exists
+						with that name, a value is used from the request or from the default value.
+						If a default bean is specified by an enclosing form tag, this attribute
+						overrides it. If you set this attribute to the empty string it overrides
+						the default bean and doesn't use any bean.
+					</description>
+					<availability>1.1</availability>
+				</attribute>
\ No newline at end of file

Added: jakarta/taglibs/proper/input/trunk/xml/attributes/checkedvalue.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/attributes/checkedvalue.xml?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/attributes/checkedvalue.xml (added)
+++ jakarta/taglibs/proper/input/trunk/xml/attributes/checkedvalue.xml Sun Apr 22 01:00:15
2007
@@ -0,0 +1,19 @@
+				<attribute>
+					<name>checkedValue</name>
+					<required>false</required>
+					<rtexprvalue>true</rtexprvalue>
+					<!-- Optional attribute type for JSP 1.2 rtexprvalue
+						<type>java.lang.String</type>
+					-->
+					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
+					<description>The checked value for this input element. If this matches the value
of this
+					input element then the element is checked. The value is used if no bean is specified
+					or if the bean doesn't exist. The value overrides any request parameters or default
value,
+					even if the value is null. Unless you require this functionality it is recommended that
+					you use the "default" attribute instead so that the form can autopopulate from the request
+					parameters.</description>
+					<!-- Used for the HTML documentation only.
+						Version of taglib when this attribute became available,
+						deprecated is a possible value. -->
+					<availability>1.2</availability>
+				</attribute>
\ No newline at end of file

Added: jakarta/taglibs/proper/input/trunk/xml/attributes/default.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/attributes/default.xml?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/attributes/default.xml (added)
+++ jakarta/taglibs/proper/input/trunk/xml/attributes/default.xml Sun Apr 22 01:00:15 2007
@@ -0,0 +1,16 @@
+				<attribute>
+					<name>default</name>
+					<required>false</required>
+					<rtexprvalue>true</rtexprvalue>
+					<!-- Optional attribute type for JSP 1.2 rtexprvalue
+						<type>java.lang.String</type>
+					-->
+					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
+					<description>The default value for this input element. The default value
+					is used if no bean is specified or found, no value is specified and no parameter exists
in
+					the request matching the name of this input element.</description>
+					<!-- Used for the HTML documentation only.
+						Version of taglib when this attribute became available,
+						deprecated is a possible value. -->
+					<availability>1.0</availability>
+				</attribute>
\ No newline at end of file

Added: jakarta/taglibs/proper/input/trunk/xml/attributes/name.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/attributes/name.xml?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/attributes/name.xml (added)
+++ jakarta/taglibs/proper/input/trunk/xml/attributes/name.xml Sun Apr 22 01:00:15 2007
@@ -0,0 +1,14 @@
+				<attribute>
+					<name>name</name>
+					<required>true</required>
+					<rtexprvalue>true</rtexprvalue>
+					<!-- Optional attribute type for JSP 1.2 rtexprvalue
+						<type>java.lang.String</type>
+					-->
+					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
+					<description>The "name" of this input element</description>
+					<!-- Used for the HTML documentation only.
+						Version of taglib when this attribute became available,
+						deprecated is a possible value. -->
+					<availability>1.0</availability>
+				</attribute>
\ No newline at end of file

Added: jakarta/taglibs/proper/input/trunk/xml/attributes/value.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/attributes/value.xml?view=auto&rev=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/attributes/value.xml (added)
+++ jakarta/taglibs/proper/input/trunk/xml/attributes/value.xml Sun Apr 22 01:00:15 2007
@@ -0,0 +1,18 @@
+				<attribute>
+					<name>value</name>
+					<required>false</required>
+					<rtexprvalue>true</rtexprvalue>
+					<!-- Optional attribute type for JSP 1.2 rtexprvalue
+						<type>java.lang.String</type>
+					-->
+					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
+					<description>The value for this input element. The value is used if no bean is
specified
+					or if the bean doesn't exist. The value overrides any request parameters or default
value,
+					even if the value is null. Unless you require this functionality it is recommended that
+					you use the "default" attribute instead so that the form can autopopulate from the request
+					parameters.</description>
+					<!-- Used for the HTML documentation only.
+						Version of taglib when this attribute became available,
+						deprecated is a possible value. -->
+					<availability>1.2</availability>
+				</attribute>
\ No newline at end of file

Modified: jakarta/taglibs/proper/input/trunk/xml/input.xml
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/input/trunk/xml/input.xml?view=diff&rev=531153&r1=531152&r2=531153
==============================================================================
--- jakarta/taglibs/proper/input/trunk/xml/input.xml (original)
+++ jakarta/taglibs/proper/input/trunk/xml/input.xml Sun Apr 22 01:00:15 2007
@@ -20,6 +20,11 @@
 <!ENTITY focus SYSTEM "input-focus.xml">
 <!ENTITY custom SYSTEM "input-custom.xml">
 <!ENTITY input-attrs SYSTEM "input-input-attrs.xml">
+<!ENTITY attr-name SYSTEM "attributes/name.xml">
+<!ENTITY attr-bean SYSTEM "attributes/bean.xml">
+<!ENTITY attr-default SYSTEM "attributes/default.xml">
+<!ENTITY attr-value SYSTEM "attributes/value.xml">
+<!ENTITY attr-checkedValue SYSTEM "attributes/checkedvalue.xml">
 ]>
 
 <document url="./input.xml">
@@ -201,7 +206,10 @@
 					<rtexprvalue>true</rtexprvalue>
 					<description>
 						id of the bean to use as the default bean for
-						input elements in the form
+						input elements in the form. If a default bean is set here
+						then it is used for all form elements unless they specify an alternate
+						bean, or specify bean="" which overrides the default bean and specifies
+						not to use a bean.
 					</description>
 					<availability>1.1</availability>
 				</attribute>
@@ -309,45 +317,10 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>text box name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>default</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>text box default value</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
-				</attribute>
+				&attr-name;
+				&attr-default;
+				&attr-value;
+				&attr-bean;
 				
 				&attrs;
 				&focus;
@@ -359,22 +332,11 @@
 			<tag>
 				<name>password</name>
 				<tag-class>org.apache.taglibs.input.Password</tag-class>
-				<!-- Optional TEI class
-					<tei-class>org.apache.taglibs.foo.fooTEI</tei-class>
-				-->
 				<body-content>empty</body-content>
 
 				<!-- JSP 1.2, display name of tag -->
 				<display-name>password</display-name>
 
-				<!-- JSP 1.2 tag library DTD only, not used for generating
-					documentation.
-					
-					<small-icon></small-icon>
-					<large-icon></large-icon>
-				-->
-				<!-- Complete description of this tag.  Used for JSP 1.2 TLD
-					and for generating HTML documentation. -->
 				<description>
 					Displays a one-line password-entry box. See
 					<a href="usage.html#password">Usage</a>
@@ -394,47 +356,10 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>password box name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.1</availability>
-				</attribute>
-				<attribute>
-					<name>default</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>
-						password box default value
-					</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.1</availability>
-				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
-				</attribute>
+				&attr-name;
+				&attr-default;
+				&attr-value;
+				&attr-bean;
 				
 				&attrs;
 				&focus;
@@ -481,45 +406,10 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>textarea name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>default</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>textarea default value</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
-				</attribute>
+				&attr-name;
+				&attr-default;
+				&attr-value;
+				&attr-bean;
 				<attribute>
 					<name>cols</name>
 					<required>false</required>
@@ -586,14 +476,6 @@
 				<!-- JSP 1.2, display name of tag -->
 				<display-name>hidden</display-name>
 
-				<!-- JSP 1.2 tag library DTD only, not used for generating
-					documentation.
-					
-					<small-icon></small-icon>
-					<large-icon></large-icon>
-				-->
-				<!-- Complete description of this tag.  Used for JSP 1.2 TLD
-					and for generating HTML documentation. -->
 				<description>
 					Creates a hidden form field. See
 					<a href="usage.html#hidden">Usage</a>
@@ -611,47 +493,10 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>hidden field name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.1</availability>
-				</attribute>
-				<attribute>
-					<name>default</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>
-						hidden field default value
-					</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.1</availability>
-				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
-				</attribute>
+				&attr-name;
+				&attr-default;
+				&attr-value;
+				&attr-bean;
 				
 				&attrs;
 				&focus;
@@ -696,64 +541,61 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
+				&attr-name;
+				&attr-default;
 				<attribute>
-					<name>name</name>
-					<required>true</required>
+					<name>defaults</name>
+					<required>false</required>
 					<rtexprvalue>true</rtexprvalue>
 					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
+						<type>java.lang.String[]</type>
 					-->
 					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>select name</description>
+					<description>
+						The default and defaults attributes for select
+						are concatenated together (if they are both
+						specified). The defaults attribute may be a
+						String[], Map or Collection.
+					</description>
 					<!-- Used for the HTML documentation only.
 						Version of taglib when this attribute became available,
 						deprecated is a possible value. -->
 					<availability>1.0</availability>
 				</attribute>
 				<attribute>
-					<name>default</name>
+					<name>selectedValue</name>
 					<required>false</required>
 					<rtexprvalue>true</rtexprvalue>
 					<!-- Optional attribute type for JSP 1.2 rtexprvalue
 						<type>java.lang.String</type>
 					-->
 					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>select default value</description>
+					<description>The selected value for this select box. The value is used if no bean
is specified
+					or if the bean doesn't exist. The value overrides any request parameters or default
value,
+					even if the value is null. Unless you require this functionality it is recommended that
+					you use the "default" attribute instead so that the form can autopopulate from the request
+					parameters.</description>
 					<!-- Used for the HTML documentation only.
 						Version of taglib when this attribute became available,
 						deprecated is a possible value. -->
-					<availability>1.0</availability>
+					<availability>1.2</availability>
 				</attribute>
 				<attribute>
-					<name>defaults</name>
+					<name>selectedValues</name>
 					<required>false</required>
 					<rtexprvalue>true</rtexprvalue>
 					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String[]</type>
+						<type>java.lang.String</type>
 					-->
 					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>
-						The default and defaults attributes for select
-						are concatenated together (if they are both
-						specified). The defaults attribute may be a
-						String[], Map or Collection.
-					</description>
+					<description>As for "selectedValue" but takes an array of values. If both "selectedValue"
and "selectedValues"
+					are provided they are concatenated.</description>
 					<!-- Used for the HTML documentation only.
 						Version of taglib when this attribute became available,
 						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
+					<availability>1.2</availability>
 				</attribute>
+				&attr-bean;
 				<attribute>
 					<name>multiple</name>
 					<required>false</required>
@@ -864,12 +706,6 @@
 				<!-- JSP 1.2, display name of tag -->
 				<display-name>option</display-name>
 
-				<!-- JSP 1.2 tag library DTD only, not used for generating
-					documentation.
-					
-					<small-icon></small-icon>
-					<large-icon></large-icon>
-				-->
 				<!-- Complete description of this tag.  Used for JSP 1.2 TLD
 					and for generating HTML documentation. -->
 				<description>
@@ -930,12 +766,6 @@
 				<!-- JSP 1.2, display name of tag -->
 				<display-name>radio</display-name>
 
-				<!-- JSP 1.2 tag library DTD only, not used for generating
-					documentation.
-					
-					<small-icon></small-icon>
-					<large-icon></large-icon>
-				-->
 				<!-- Complete description of this tag.  Used for JSP 1.2 TLD
 					and for generating HTML documentation. -->
 				<description>
@@ -955,36 +785,8 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>radio button name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
-				<attribute>
-					<name>default</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>
-						radio button default value.
-					</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
+				&attr-name;
+				&attr-default;
 				<attribute>
 					<name>value</name>
 					<required>true</required>
@@ -995,17 +797,8 @@
 					</description>
 					<availability>1.0</availability>
 				</attribute>
-				<attribute>
-					<name>bean</name>
-					<required>false</required>
-					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
-				</attribute>
+				&attr-checkedValue;
+				&attr-bean;
 				
 				&attrs;
 				&focus;
@@ -1025,12 +818,6 @@
 				<!-- JSP 1.2, display name of tag -->
 				<display-name>checkbox</display-name>
 
-				<!-- JSP 1.2 tag library DTD only, not used for generating
-					documentation.
-					
-					<small-icon></small-icon>
-					<large-icon></large-icon>
-				-->
 				<!-- Complete description of this tag.  Used for JSP 1.2 TLD
 					and for generating HTML documentation. -->
 				<description>
@@ -1050,20 +837,7 @@
 				<!-- Any restrictions on use of the tag -->
 				<restrictions>None</restrictions>
 
-				<attribute>
-					<name>name</name>
-					<required>true</required>
-					<rtexprvalue>true</rtexprvalue>
-					<!-- Optional attribute type for JSP 1.2 rtexprvalue
-						<type>java.lang.String</type>
-					-->
-					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
-					<description>checkbox name</description>
-					<!-- Used for the HTML documentation only.
-						Version of taglib when this attribute became available,
-						deprecated is a possible value. -->
-					<availability>1.0</availability>
-				</attribute>
+				&attr-name;
 				<attribute>
 					<name>default</name>
 					<required>false</required>
@@ -1113,17 +887,23 @@
 					</description>
 					<availability>1.0</availability>
 				</attribute>
+				&attr-checkedValue;
 				<attribute>
-					<name>bean</name>
+					<name>checkedValues</name>
 					<required>false</required>
 					<rtexprvalue>true</rtexprvalue>
-					<description>
-						id of the bean to get default value from. Empty
-						string means no bean (not even the default from
-						the form tag, if supplied)
-					</description>
-					<availability>1.1</availability>
+					<!-- Optional attribute type for JSP 1.2 rtexprvalue
+						<type>java.lang.String</type>
+					-->
+					<!-- Used for JSP 1.2 TLD and generating HTML docs -->
+					<description>As for "checkedValue" but takes an array of values. If both "checkedValue"
and "checkedValues"
+					are provided they are concatenated.</description>
+					<!-- Used for the HTML documentation only.
+						Version of taglib when this attribute became available,
+						deprecated is a possible value. -->
+					<availability>1.2</availability>
 				</attribute>
+				&attr-bean;
 				
 				&attrs;
 				&focus;
@@ -1171,7 +951,7 @@
 			default value.
 		</description>
 	</revision>
-
+	
 	<revision release="1.1" date="09/24/2002">
 		<description>
 			Addition of new functionality, making some parts of the
@@ -1205,6 +985,23 @@
 			<item>
 				Add multiple attribute to select tag, and support for
 				multiple defaults.
+			</item>
+		</section>
+	</revision>
+
+	<revision release="1.2" date="04/22/2007">
+		<description>
+			TODO The new features list serves as notes for writing this.
+		</description>
+		<section name="New Features">
+			<item>
+				Array support
+			</item>
+			<item>
+				Checkbox default usage detection
+			</item>
+			<item>
+				Add value, selectedValue(s), checkedValue(s) to tags to force a value
 			</item>
 		</section>
 	</revision>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message