You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/06/16 06:41:13 UTC
cvs commit: jakarta-struts/web/example logon.jsp registration.jsp subscription.jsp
craigmcc 00/06/15 21:41:13
Modified: src/conf struts.tld
src/share/org/apache/struts/taglib BaseFieldTag.java
BaseInputTag.java ButtonTag.java CheckboxTag.java
PropertyTag.java RadioTag.java SelectTag.java
SubmitTag.java TextareaTag.java
web/documentation tags.html
web/example logon.jsp registration.jsp subscription.jsp
Log:
Improve the consistency of custom tag attributes. Now, attribute "name"
always refers to a bean stored in some scope, and "property" refers to
a property of such a bean (as well as the corresponding input field).
This change affects the following tags: button, checkbox, hidden,
password, property, radio, select, submit, text, and textarea.
Adjust the example application's JSP pages to reflect these changes.
Revision Changes Path
1.9 +44 -44 jakarta-struts/src/conf/struts.tld
Index: struts.tld
===================================================================
RCS file: /home/cvs/jakarta-struts/src/conf/struts.tld,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- struts.tld 2000/06/16 01:32:21 1.8
+++ struts.tld 2000/06/16 04:41:07 1.9
@@ -276,11 +276,6 @@
<name>button</name>
<tagclass>org.apache.struts.taglib.ButtonTag</tagclass>
<attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -346,6 +341,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -367,11 +367,6 @@
<name>checkbox</name>
<tagclass>org.apache.struts.taglib.CheckboxTag</tagclass>
<attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -437,6 +432,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -458,8 +458,8 @@
<name>hidden</name>
<tagclass>org.apache.struts.taglib.HiddenTag</tagclass>
<attribute>
- <name>name</name>
- <required>name</required>
+ <name>property</name>
+ <required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
@@ -490,11 +490,6 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
- <name>name</name>
- <required>name</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -565,6 +560,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>name</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>size</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -591,8 +591,8 @@
<name>property</name>
<tagclass>org.apache.struts.taglib.PropertyTag</tagclass>
<attribute>
- <name>name</name>
- <required>name</required>
+ <name>property</name>
+ <required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
@@ -607,11 +607,6 @@
<name>radio</name>
<tagclass>org.apache.struts.taglib.RadioTag</tagclass>
<attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -677,6 +672,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -780,11 +780,6 @@
<tagclass>org.apache.struts.taglib.SelectTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -850,6 +845,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -871,11 +871,6 @@
<name>submit</name>
<tagclass>org.apache.struts.taglib.SubmitTag</tagclass>
<attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -941,6 +936,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -967,11 +967,6 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
- <name>name</name>
- <required>name</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -1042,6 +1037,11 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
+ <name>property</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
<name>size</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -1073,11 +1073,6 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
- <name>name</name>
- <required>name</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
<name>onBlur</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -1145,6 +1140,11 @@
<attribute>
<name>onSelect</name>
<required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>property</name>
+ <required>name</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
1.3 +7 -7 jakarta-struts/src/share/org/apache/struts/taglib/BaseFieldTag.java
Index: BaseFieldTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseFieldTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BaseFieldTag.java 2000/06/15 01:27:32 1.2
+++ BaseFieldTag.java 2000/06/16 04:41:07 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseFieldTag.java,v 1.2 2000/06/15 01:27:32 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/15 01:27:32 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseFieldTag.java,v 1.3 2000/06/16 04:41:07 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/16 04:41:07 $
*
* ====================================================================
*
@@ -77,7 +77,7 @@
* Convenience base class for the various input tags for text fields.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/06/15 01:27:32 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/16 04:41:07 $
*/
public abstract class BaseFieldTag extends BaseInputTag {
@@ -107,7 +107,7 @@
StringBuffer results = new StringBuffer("<input type=\"");
results.append(type);
results.append("\" name=\"");
- results.append(name);
+ results.append(property);
results.append("\"");
if (maxlength >= 0) {
results.append(" maxlength=\"");
@@ -126,8 +126,8 @@
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
Object value = null;
1.3 +12 -12 jakarta-struts/src/share/org/apache/struts/taglib/BaseInputTag.java
Index: BaseInputTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseInputTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BaseInputTag.java 2000/06/15 01:27:34 1.2
+++ BaseInputTag.java 2000/06/16 04:41:07 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseInputTag.java,v 1.2 2000/06/15 01:27:34 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/15 01:27:34 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseInputTag.java,v 1.3 2000/06/16 04:41:07 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/16 04:41:07 $
*
* ====================================================================
*
@@ -74,7 +74,7 @@
* Abstract base class for the various input tags.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/06/15 01:27:34 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/16 04:41:07 $
*/
public abstract class BaseInputTag extends BaseHandlerTag {
@@ -107,7 +107,7 @@
/**
* The name of the field (and associated property) being processed.
*/
- protected String name = null;
+ protected String property = null;
/**
@@ -203,23 +203,23 @@
/**
- * Return the field name.
+ * Return the property name.
*/
- public String getName() {
+ public String getProperty() {
- return (this.name);
+ return (this.property);
}
/**
- * Set the object name.
+ * Set the property name.
*
- * @param name The new object name
+ * @param property The new property name
*/
- public void setName(String name) {
+ public void setProperty(String property) {
- this.name = name;
+ this.property = property;
}
1.2 +17 -16 jakarta-struts/src/share/org/apache/struts/taglib/ButtonTag.java
Index: ButtonTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/ButtonTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ButtonTag.java 2000/06/15 01:27:34 1.1
+++ ButtonTag.java 2000/06/16 04:41:07 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/ButtonTag.java,v 1.1 2000/06/15 01:27:34 craigmcc Exp $
- * $Revision: 1.1 $
- * $Date: 2000/06/15 01:27:34 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/ButtonTag.java,v 1.2 2000/06/16 04:41:07 craigmcc Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/06/16 04:41:07 $
*
* ====================================================================
*
@@ -74,7 +74,7 @@
* Renders an HTML BUTTON tag within the Struts framework.
*
* @author Don Clasen
- * @version $Revision: 1.1 $ $Date: 2000/06/15 01:27:34 $
+ * @version $Revision: 1.2 $ $Date: 2000/06/16 04:41:07 $
*/
public final class ButtonTag extends BaseHandlerTag {
@@ -83,9 +83,9 @@
// ----------------------------------------------------- Instance Variables
/**
- * The name of the generated button.
+ * The property name of the generated button.
*/
- private String name = null;
+ private String property = null;
/**
@@ -98,18 +98,19 @@
/**
- * Return the component name.
+ * Return the property name.
*/
- public String getName() {
- return (name);
+ public String getProperty() {
+ return (property);
}
/**
- * Set the component name.
- * @param name The component name
+ * Set the property name.
+ *
+ * @param name The property name
*/
- public void setName(String name) {
- this.name = name;
+ public void setProperty(String property) {
+ this.property = property;
}
@@ -156,9 +157,9 @@
// Generate an HTML element
StringBuffer results = new StringBuffer();
results.append("<input type=\"button\"");
- if (name != null) {
+ if (property != null) {
results.append(" name=\"");
- results.append(name);
+ results.append(property);
results.append("\"");
}
results.append(" value=\"");
@@ -183,4 +184,4 @@
}
-}
\ No newline at end of file
+}
1.4 +18 -17 jakarta-struts/src/share/org/apache/struts/taglib/CheckboxTag.java
Index: CheckboxTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/CheckboxTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CheckboxTag.java 2000/06/15 01:27:34 1.3
+++ CheckboxTag.java 2000/06/16 04:41:08 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/CheckboxTag.java,v 1.3 2000/06/15 01:27:34 craigmcc Exp $
- * $Revision: 1.3 $
- * $Date: 2000/06/15 01:27:34 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/CheckboxTag.java,v 1.4 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* Tag for input fields of type "checkbox".
*
* @author Craig R. McClanahan
- * @version $Revision: 1.3 $ $Date: 2000/06/15 01:27:34 $
+ * @version $Revision: 1.4 $ $Date: 2000/06/16 04:41:08 $
*/
public final class CheckboxTag extends BaseHandlerTag {
@@ -94,9 +94,9 @@
/**
- * The field name for this field.
+ * The property name for this field.
*/
- private String name = null;
+ private String property = null;
/**
@@ -109,23 +109,23 @@
/**
- * Return the field name.
+ * Return the property name.
*/
- public String getName() {
+ public String getProperty() {
- return (this.name);
+ return (this.property);
}
/**
- * Set the field name.
+ * Set the property name.
*
- * @param name The new field name
+ * @param property The new property name
*/
- public void setName(String name) {
+ public void setProperty(String property) {
- this.name = name;
+ this.property = property;
}
@@ -165,15 +165,15 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<input type=\"checkbox\"");
results.append(" name=\"");
- results.append(this.name);
+ results.append(this.property);
results.append("\"");
String value = this.value;
if (value == null) {
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
try {
@@ -190,7 +190,8 @@
methodName, e.toString()));
}
}
- if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes"))
+ if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes")
+ || value.equalsIgnoreCase("on"))
results.append(" checked");
results.append(prepareEventHandlers());
results.append(prepareStyles());
1.3 +6 -6 jakarta-struts/src/share/org/apache/struts/taglib/PropertyTag.java
Index: PropertyTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/PropertyTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PropertyTag.java 2000/06/15 01:27:35 1.2
+++ PropertyTag.java 2000/06/16 04:41:08 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/PropertyTag.java,v 1.2 2000/06/15 01:27:35 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/15 01:27:35 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/PropertyTag.java,v 1.3 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -77,7 +77,7 @@
* Display the value of the specified bean property as read-only HTML text.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/06/15 01:27:35 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/16 04:41:08 $
*/
public class PropertyTag extends BaseInputTag {
@@ -101,8 +101,8 @@
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
Object value = null;
1.4 +16 -16 jakarta-struts/src/share/org/apache/struts/taglib/RadioTag.java
Index: RadioTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/RadioTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RadioTag.java 2000/06/15 01:27:35 1.3
+++ RadioTag.java 2000/06/16 04:41:08 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/RadioTag.java,v 1.3 2000/06/15 01:27:35 craigmcc Exp $
- * $Revision: 1.3 $
- * $Date: 2000/06/15 01:27:35 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/RadioTag.java,v 1.4 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* Tag for input fields of type "radio".
*
* @author Craig R. McClanahan
- * @version $Revision: 1.3 $ $Date: 2000/06/15 01:27:35 $
+ * @version $Revision: 1.4 $ $Date: 2000/06/16 04:41:08 $
*/
public final class RadioTag extends BaseHandlerTag {
@@ -94,9 +94,9 @@
/**
- * The field name for this field.
+ * The property name for this field.
*/
- private String name = null;
+ private String property = null;
/**
@@ -109,23 +109,23 @@
/**
- * Return the field name.
+ * Return the property name.
*/
- public String getName() {
+ public String getProperty() {
- return (this.name);
+ return (this.property);
}
/**
- * Set the field name.
+ * Set the property name.
*
- * @param name The new field name
+ * @param name The new property name
*/
- public void setName(String name) {
+ public void setProperty(String property) {
- this.name = name;
+ this.property = property;
}
@@ -167,8 +167,8 @@
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
try {
@@ -188,7 +188,7 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<input type=\"radio\"");
results.append(" name=\"");
- results.append(this.name);
+ results.append(this.property);
results.append("\" value=\"");
results.append(this.value);
results.append("\"");
1.3 +13 -13 jakarta-struts/src/share/org/apache/struts/taglib/SelectTag.java
Index: SelectTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SelectTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SelectTag.java 2000/06/15 01:27:36 1.2
+++ SelectTag.java 2000/06/16 04:41:08 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SelectTag.java,v 1.2 2000/06/15 01:27:36 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/15 01:27:36 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SelectTag.java,v 1.3 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -79,7 +79,7 @@
* inside a form tag.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/06/15 01:27:36 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/16 04:41:08 $
*/
public final class SelectTag extends BaseHandlerTag {
@@ -105,7 +105,7 @@
/**
* The property name we are associated with.
*/
- private String name = null;
+ private String property = null;
/**
@@ -130,9 +130,9 @@
/**
* Return the property name.
*/
- public String getName() {
+ public String getProperty() {
- return (this.name);
+ return (this.property);
}
@@ -140,11 +140,11 @@
/**
* Set the property name.
*
- * @param name The new attribute key name
+ * @param property The new property name
*/
- public void setName(String name) {
+ public void setProperty(String property) {
- this.name = name;
+ this.property = property;
}
@@ -184,7 +184,7 @@
// Create an appropriate "form" element based on our parameters
StringBuffer results = new StringBuffer("<select");
results.append(" name=\"");
- results.append(name);
+ results.append(property);
results.append("\"");
results.append(prepareEventHandlers());
results.append(prepareStyles());
@@ -209,8 +209,8 @@
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
Object value = null;
1.3 +13 -13 jakarta-struts/src/share/org/apache/struts/taglib/SubmitTag.java
Index: SubmitTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SubmitTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SubmitTag.java 2000/06/15 01:27:36 1.2
+++ SubmitTag.java 2000/06/16 04:41:08 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SubmitTag.java,v 1.2 2000/06/15 01:27:36 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 2000/06/15 01:27:36 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/SubmitTag.java,v 1.3 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -76,7 +76,7 @@
* Tag for input fields of type "submit".
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/06/15 01:27:36 $
+ * @version $Revision: 1.3 $ $Date: 2000/06/16 04:41:08 $
*/
public final class SubmitTag extends BaseHandlerTag {
@@ -96,7 +96,7 @@
/**
* The name of the generated input field.
*/
- private String name = "submit";
+ private String property = "submit";
/**
@@ -109,23 +109,23 @@
/**
- * Return the field name.
+ * Return the property.
*/
- public String getName() {
+ public String getProperty() {
- return (this.name);
+ return (this.property);
}
/**
- * Set the field name.
+ * Set the property name.
*
- * @param name The field name
+ * @param property The property name
*/
- public void setName(String name) {
+ public void setProperty(String property) {
- this.name = name;
+ this.property = property;
}
@@ -186,7 +186,7 @@
// Generate an HTML element
StringBuffer results = new StringBuffer();
results.append("<input type=\"submit\" name=\"");
- results.append(name);
+ results.append(property);
results.append("\" value=\"");
results.append(label);
results.append("\"");
1.6 +7 -7 jakarta-struts/src/share/org/apache/struts/taglib/TextareaTag.java
Index: TextareaTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/TextareaTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TextareaTag.java 2000/06/12 18:31:20 1.5
+++ TextareaTag.java 2000/06/16 04:41:08 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/TextareaTag.java,v 1.5 2000/06/12 18:31:20 craigmcc Exp $
- * $Revision: 1.5 $
- * $Date: 2000/06/12 18:31:20 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/TextareaTag.java,v 1.6 2000/06/16 04:41:08 craigmcc Exp $
+ * $Revision: 1.6 $
+ * $Date: 2000/06/16 04:41:08 $
*
* ====================================================================
*
@@ -77,7 +77,7 @@
* Custom tag for input fields of type "textarea".
*
* @author Craig R. McClanahan
- * @version $Revision: 1.5 $ $Date: 2000/06/12 18:31:20 $
+ * @version $Revision: 1.6 $ $Date: 2000/06/16 04:41:08 $
*/
public class TextareaTag extends BaseInputTag {
@@ -109,7 +109,7 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<textarea");
results.append(" name=\"");
- results.append(name);
+ results.append(property);
results.append("\"");
if (cols >= 0) {
results.append(" cols=\"");
@@ -128,8 +128,8 @@
Object bean = pageContext.findAttribute(Constants.BEAN_KEY);
if (bean == null)
throw new JspException
- (messages.getMessage("baseFieldTag.missing", name));
- String methodName = "get" + BeanUtils.capitalize(name);
+ (messages.getMessage("baseFieldTag.missing", property));
+ String methodName = "get" + BeanUtils.capitalize(property);
Class paramTypes[] = new Class[0];
Method method = null;
Object value = null;
1.8 +64 -64 jakarta-struts/web/documentation/tags.html
Index: tags.html
===================================================================
RCS file: /home/cvs/jakarta-struts/web/documentation/tags.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- tags.html 2000/06/15 18:15:19 1.7
+++ tags.html 2000/06/16 04:41:10 1.8
@@ -33,13 +33,6 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of the request parameter that will be included with this
- submission, set to the specified value.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -129,6 +122,13 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of the request parameter that will be included with this
+ submission, set to the specified value.
+ </td>
+ </tr>
+ <tr>
<td align="center">style</td>
<td>
CSS styles to be applied to this HTML element.
@@ -167,14 +167,6 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property if <code>value</code> is not specified. The corresponding
- bean property (if any) must be of type <code>boolean</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -264,6 +256,14 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property if <code>value</code> is not specified. The corresponding
+ bean property (if any) must be of type <code>boolean</code>.
+ </td>
+ </tr>
+ <tr>
<td align="center">style</td>
<td>
CSS styles to be applied to this HTML element.
@@ -517,7 +517,7 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
+ <td align="center">property</td>
<td>
Name of this input field, and the name of the corresponding bean
property if <code>value</code> is not specified. The corresponding
@@ -913,14 +913,6 @@
</td>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property if <code>value</code> is not specified. The corresponding
- bean property (if any) must be of type <code>String</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1017,6 +1009,14 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property if <code>value</code> is not specified. The corresponding
+ bean property (if any) must be of type <code>String</code>.
+ </td>
+ </tr>
+ <tr>
<td align="center">size</td>
<td>
Number of character positions to allocate. [Browser default]
@@ -1060,7 +1060,7 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
+ <td align="center">property</td>
<td>
Name of this input field, and the name of the corresponding bean
property if <code>value</code> is not specified. The corresponding
@@ -1093,14 +1093,6 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property. The corresponding bean property must be of type
- <code>String</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1190,6 +1182,14 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property. The corresponding bean property must be of type
+ <code>String</code>.
+ </td>
+ </tr>
+ <tr>
<td align="center">style</td>
<td>
CSS styles to be applied to this HTML element.
@@ -1377,14 +1377,6 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property if <code>value</code> is not specified. The corresponding
- bean property (if any) must be of type <code>String</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1474,6 +1466,14 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property if <code>value</code> is not specified. The corresponding
+ bean property (if any) must be of type <code>String</code>.
+ </td>
+ </tr>
+ <tr>
<td align="center">style</td>
<td>
CSS styles to be applied to this HTML element.
@@ -1510,13 +1510,6 @@
<th width="85%">Description</th>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of the request parameter that will be included with this
- submission, set to the specified value. [submit]
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1606,6 +1599,13 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of the request parameter that will be included with this
+ submission, set to the specified value. [submit]
+ </td>
+ </tr>
+ <tr>
<td align="center">style</td>
<td>
CSS styles to be applied to this HTML element.
@@ -1650,14 +1650,6 @@
</td>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property if <code>value</code> is not specified. The corresponding
- bean property (if any) must be of type <code>String</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1754,6 +1746,14 @@
</td>
</tr>
<tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property if <code>value</code> is not specified. The corresponding
+ bean property (if any) must be of type <code>String</code>.
+ </td>
+ </tr>
+ <tr>
<td align="center">size</td>
<td>
Number of character positions to allocate. [Browser default]
@@ -1802,14 +1802,6 @@
</td>
</tr>
<tr>
- <td align="center">name</td>
- <td>
- Name of this input field, and the name of the corresponding bean
- property if <code>value</code> is not specified. The corresponding
- bean property (if any) must be of type <code>String</code>.
- </td>
- </tr>
- <tr>
<td align="center">onBlur</td>
<td>
JavaScript event handler executed when this element loses input focus.
@@ -1903,6 +1895,14 @@
<td>
JavaScript event handler executed when this element has focus and
some text is selected.
+ </td>
+ </tr>
+ <tr>
+ <td align="center">property</td>
+ <td>
+ Name of this input field, and the name of the corresponding bean
+ property if <code>value</code> is not specified. The corresponding
+ bean property (if any) must be of type <code>String</code>.
</td>
</tr>
<tr>
1.2 +3 -3 jakarta-struts/web/example/logon.jsp
Index: logon.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/example/logon.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- logon.jsp 2000/05/31 22:28:10 1.1
+++ logon.jsp 2000/06/16 04:41:12 1.2
@@ -18,7 +18,7 @@
<struts:message key="prompt.username"/>
</th>
<td align="left">
- <struts:text name="username" size="16" maxlength="16"/>
+ <struts:text property="username" size="16" maxlength="16"/>
</td>
</tr>
@@ -27,13 +27,13 @@
<struts:message key="prompt.password"/>
</th>
<td align="left">
- <struts:password name="password" size="16" maxlength="16"/>
+ <struts:password property="password" size="16" maxlength="16"/>
</td>
</tr>
<tr>
<td align="right">
- <struts:submit name="submit" value="Submit"/>
+ <struts:submit property="submit" value="Submit"/>
</td>
<td align="left">
<struts:reset/>
1.3 +19 -14 jakarta-struts/web/example/registration.jsp
Index: registration.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/example/registration.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- registration.jsp 2000/06/16 01:32:26 1.2
+++ registration.jsp 2000/06/16 04:41:12 1.3
@@ -4,10 +4,12 @@
<html>
<head>
-<struts:ifPropertyEquals name="registrationForm" property="action" value="Create">
+<struts:ifPropertyEquals name="registrationForm"
+ property="action" value="Create">
<title><struts:message key="registration.title.create"/></title>
</struts:ifPropertyEquals>
-<struts:ifPropertyEquals name="registrationForm" property="action" value="Edit">
+<struts:ifPropertyEquals name="registrationForm"
+ property="action" value="Edit">
<title><struts:message key="registration.title.edit"/></title>
</struts:ifPropertyEquals>
</head>
@@ -17,7 +19,7 @@
<struts:form action="saveRegistration.do" name="registrationForm"
type="org.apache.struts.example.RegistrationForm">
-<struts:hidden name="action"/>
+<struts:hidden property="action"/>
<table border="0" width="100%">
<tr>
@@ -25,12 +27,14 @@
<struts:message key="prompt.username"/>
</th>
<td align="left">
- <struts:ifPropertyEquals name="registrationForm" property="action" value="Create">
- <struts:text name="username" size="16" maxlength="16"/>
+ <struts:ifPropertyEquals name="registrationForm"
+ property="action" value="Create">
+ <struts:text property="username" size="16" maxlength="16"/>
</struts:ifPropertyEquals>
- <struts:ifPropertyEquals name="registrationForm" property="action" value="Edit">
- <struts:property name="username"/>
- <struts:hidden name="username"/>
+ <struts:ifPropertyEquals name="registrationForm"
+ property="action" value="Edit">
+ <struts:property property="username"/>
+ <struts:hidden property="username"/>
</struts:ifPropertyEquals>
</td>
</tr>
@@ -40,7 +44,7 @@
<struts:message key="prompt.password"/>
</th>
<td align="left">
- <struts:password name="password" size="16" maxlength="16"/>
+ <struts:password property="password" size="16" maxlength="16"/>
</td>
</tr>
@@ -49,7 +53,7 @@
<struts:message key="prompt.password2"/>
</th>
<td align="left">
- <struts:password name="password2" size="16" maxlength="16"/>
+ <struts:password property="password2" size="16" maxlength="16"/>
</td>
</tr>
@@ -58,7 +62,7 @@
<struts:message key="prompt.fullName"/>
</th>
<td align="left">
- <struts:text name="fullName" size="50"/>
+ <struts:text property="fullName" size="50"/>
</td>
</tr>
@@ -67,7 +71,7 @@
<struts:message key="prompt.fromAddress"/>
</th>
<td align="left">
- <struts:text name="fromAddress" size="50"/>
+ <struts:text property="fromAddress" size="50"/>
</td>
</tr>
@@ -76,7 +80,7 @@
<struts:message key="prompt.replyToAddress"/>
</th>
<td align="left">
- <struts:text name="replyToAddress" size="50"/>
+ <struts:text property="replyToAddress" size="50"/>
</td>
</tr>
@@ -100,7 +104,8 @@
</table>
</struts:form>
-<struts:ifPropertyEquals name="registrationForm" property="action" value="Edit">
+<struts:ifPropertyEquals name="registrationForm"
+ property="action" value="Edit">
<div align="center">
<h3><struts:message key="heading.subscriptions"/></h3>
1.3 +16 -16 jakarta-struts/web/example/subscription.jsp
Index: subscription.jsp
===================================================================
RCS file: /home/cvs/jakarta-struts/web/example/subscription.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- subscription.jsp 2000/06/16 01:32:26 1.2
+++ subscription.jsp 2000/06/16 04:41:12 1.3
@@ -4,15 +4,18 @@
<html>
<head>
-<struts:ifParameterEquals name="action" value="Create">
+<struts:ifPropertyEquals name="subscriptionForm"
+ property="action" value="Create">
<title><struts:message key="subscription.title.create"/></title>
-</struts:ifParameterEquals>
-<struts:ifParameterEquals name="action" value="Delete">
+</struts:ifPropertyEquals>
+<struts:ifPropertyEquals name="subscriptionForm"
+ property="action" value="Delete">
<title><struts:message key="subscription.title.delete"/></title>
-</struts:ifParameterEquals>
-<struts:ifParameterEquals name="action" value="Edit">
+</struts:ifPropertyEquals>
+<struts:ifPropertyEquals name="subscriptionForm"
+ property="action" value="Edit">
<title><struts:message key="subscription.title.edit"/></title>
-</struts:ifParameterEquals>
+</struts:ifPropertyEquals>
</head>
<body bgcolor="white">
@@ -20,7 +23,7 @@
<struts:form action="saveSubscription.do" name="subscriptionForm"
type="org.apache.struts.example.SubscriptionForm">
-<struts:hidden name="action"/>
+<struts:hidden property="action"/>
<table border="0" width="100%">
<tr>
@@ -37,7 +40,7 @@
<struts:message key="prompt.mailHostname"/>
</th>
<td align="left">
- <struts:text name="host" size="50"/>
+ <struts:text property="host" size="50"/>
</td>
</tr>
@@ -46,7 +49,7 @@
<struts:message key="prompt.mailUsername"/>
</th>
<td align="left">
- <struts:text name="username" size="50"/>
+ <struts:text property="username" size="50"/>
</td>
</tr>
@@ -55,7 +58,7 @@
<struts:message key="prompt.mailPassword"/>
</th>
<td align="left">
- <struts:password name="password" size="50"/>
+ <struts:password property="password" size="50"/>
</td>
</tr>
@@ -65,7 +68,7 @@
</th>
<td align="left">
<%--
- <struts:select name="type">
+ <struts:select property="type">
<struts:option value="pop3">
<struts:message key="option.pop3"/>
</struts:option>
@@ -74,10 +77,10 @@
</struts:option>
</struts:select>
--%>
- <struts:radio name="type" value="imap">
+ <struts:radio property="type" value="imap">
<struts:message key="option.imap"/>
</struts:radio>
- <struts:radio name="type" value="pop3">
+ <struts:radio property="type" value="pop3">
<struts:message key="option.pop3"/>
</struts:radio>
</td>
@@ -110,8 +113,5 @@
</tr>
</table>
-
-<input type="hidden" name="action"
- value="<struts:parameter name="action"/>">
</struts:form>