sraeburn 2003/08/10 02:14:04
Modified: contrib/struts-el/src/share/org/apache/strutsel/taglib/html
ELFormTag.java
contrib/struts-el/doc/userGuide struts-html-el.xml
src/share/org/apache/struts/taglib/html FormTag.java
src/share/org/apache/struts/taglib/nested/html
NestedFormTag.java
doc/userGuide struts-html.xml struts-nested.xml
Log:
Removed deprecated FormTag attributes: name, scope, type
Also affects nested and el form tags.
I added a name property to NestedFormTag because it is used internally
for nesting. Someone familiar with nested tags may know a better way.
Revision Changes Path
1.11 +5 -64
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELFormTag.java
Index: ELFormTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELFormTag.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ELFormTag.java 10 Aug 2003 00:48:28 -0000 1.10
+++ ELFormTag.java 10 Aug 2003 09:14:04 -0000 1.11
@@ -6,7 +6,7 @@
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -105,11 +105,6 @@
*/
private String methodExpr;
/**
- * Instance variable mapped to "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- private String nameExpr;
- /**
* Instance variable mapped to "onreset" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -120,11 +115,6 @@
*/
private String onsubmitExpr;
/**
- * Instance variable mapped to "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- private String scopeExpr;
- /**
* Instance variable mapped to "scriptLanguage" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -149,11 +139,6 @@
* (Mapping set in associated BeanInfo class.)
*/
private String targetExpr;
- /**
- * Instance variable mapped to "type" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- private String typeExpr;
/**
* Getter method for "action" tag attribute.
@@ -181,11 +166,6 @@
*/
public String getMethodExpr() { return (methodExpr); }
/**
- * Getter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public String getNameExpr() { return (nameExpr); }
- /**
* Getter method for "onreset" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -196,11 +176,6 @@
*/
public String getOnsubmitExpr() { return (onsubmitExpr); }
/**
- * Getter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public String getScopeExpr() { return (scopeExpr); }
- /**
* Getter method for "scriptLanguage" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -225,11 +200,6 @@
* (Mapping set in associated BeanInfo class.)
*/
public String getTargetExpr() { return (targetExpr); }
- /**
- * Getter method for "type" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public String getTypeExpr() { return (typeExpr); }
/**
* Setter method for "action" tag attribute.
@@ -257,11 +227,6 @@
*/
public void setMethodExpr(String methodExpr) { this.methodExpr = methodExpr; }
/**
- * Setter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; }
- /**
* Setter method for "onreset" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -272,11 +237,6 @@
*/
public void setOnsubmitExpr(String onsubmitExpr) { this.onsubmitExpr =
onsubmitExpr; }
/**
- * Setter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; }
- /**
* Setter method for "scriptLanguage" tag attribute.
* (Mapping set in associated BeanInfo class.)
*/
@@ -301,11 +261,6 @@
* (Mapping set in associated BeanInfo class.)
*/
public void setTargetExpr(String targetExpr) { this.targetExpr = targetExpr; }
- /**
- * Setter method for "type" tag attribute.
- * (Mapping set in associated BeanInfo class.)
- */
- public void setTypeExpr(String typeExpr) { this.typeExpr = typeExpr; }
/**
* Resets attribute values for tag reuse.
@@ -318,16 +273,13 @@
setFocusExpr(null);
setFocusIndexExpr(null);
setMethodExpr(null);
- setNameExpr(null);
setOnresetExpr(null);
setOnsubmitExpr(null);
- setScopeExpr(null);
setScriptLanguageExpr(null);
setStyleExpr(null);
setStyleClassExpr(null);
setStyleIdExpr(null);
setTargetExpr(null);
- setTypeExpr(null);
}
/**
@@ -370,10 +322,6 @@
this, pageContext)) != null)
setMethod(string);
- if ((string = EvalHelper.evalString("name", getNameExpr(),
- this, pageContext)) != null)
- setName(string);
-
if ((string = EvalHelper.evalString("onreset", getOnresetExpr(),
this, pageContext)) != null)
setOnreset(string);
@@ -382,10 +330,6 @@
this, pageContext)) != null)
setOnsubmit(string);
- if ((string = EvalHelper.evalString("scope", getScopeExpr(),
- this, pageContext)) != null)
- setScope(string);
-
if ((bool = EvalHelper.evalBoolean("scriptLanguage", getScriptLanguageExpr(),
this, pageContext)) != null)
setScriptLanguage(bool.booleanValue());
@@ -406,8 +350,5 @@
this, pageContext)) != null)
setTarget(string);
- if ((string = EvalHelper.evalString("type", getTypeExpr(),
- this, pageContext)) != null)
- setType(string);
}
}
1.20 +3 -91
jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml
Index: struts-html-el.xml
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- struts-html-el.xml 26 Jul 2003 05:48:02 -0000 1.19
+++ struts-html-el.xml 10 Aug 2003 09:14:04 -0000 1.20
@@ -1366,28 +1366,8 @@
the input fields with the current property values from the bean.
</p>
<p>
- The associated form bean is determined in one of two ways:
- </p>
- <ul>
- <li>
- If the <code>name</code> and <code>type</code> attributes
- are not specified, then the form bean will be located, and
- created if necessary, based on the form bean specification
- for the associated <code>ActionMapping</code>.
- </li>
- <li>
- If the <code>name</code> and <code>type</code> attributes
- are specified, then the form bean will be located, and created
- if necessary, using the specified values for <code>name</code>,
- <code>type</code> and <code>scope</code>.
- </li>
- </ul>
- <p>
- <strong>NOTE</strong>: The use of the <code>name</code>,
- <code>type</code> and <code>scope</code> attributes is
- deprecated. The preferred usage is to allow the appropriate
- values to be determined automatically from the corresponding
- <code>ActionMapping</code>.
+ The form bean is located, and created if necessary, based on the
+ form bean specification for the associated
<code>ActionMapping</code>.
</p>
</info>
@@ -1459,31 +1439,6 @@
</attribute>
<attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <info>
- <p>Name of the request scope or session scope bean
- (as defined by the <code>scope</code> attribute)
- whose properties will be used to populate the input
- field values. If no such bean is found, a new bean
- will be created and added to the appropriate scope,
- using the Java class name specified by the
- <code>type</code> attribute.</p>
-
- <p>If this attribute is not specified, the name of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean name will be selected.</p>
- </info>
- <deprecated>
- The bean name will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
-
- <attribute>
<name>onreset</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -1501,28 +1456,6 @@
</info>
</attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <info>
- <p>Scope within which the form bean associated with
- this input form will be accessed or created (must be
- either <code>request</code> or <code>session</code>).
- </p>
-
- <p>If this attribute is not specified, the scope of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean scope will be selected.</p>
- </info>
- <deprecated>
- The bean scope will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
-
<attribute>
<name>scriptLanguage</name>
<required>false</required>
@@ -1573,28 +1506,7 @@
for use in framed presentations.
</info>
</attribute>
-
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <info>
- <p>Fully qualified Java class name of the form bean to
- be created, if no such bean is found in the specified
- scope.</p>
-
- <p>If this attribute is not specified, the type of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean type will be selected.</p>
- </info>
- <deprecated>
- The bean type will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
- </tag>
+ </tag>
<tag>
1.55 +11 -115
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
Index: FormTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- FormTag.java 31 Jul 2003 00:25:39 -0000 1.54
+++ FormTag.java 10 Aug 2003 09:14:04 -0000 1.55
@@ -146,11 +146,6 @@
protected String method = null;
/**
- * The attribute key under which our associated bean is stored.
- */
- protected String name = null;
-
- /**
* The onReset event script.
*/
protected String onreset = null;
@@ -161,12 +156,6 @@
protected String onsubmit = null;
/**
- * The scope (request or session) under which our associated bean
- * is stored.
- */
- protected String scope = null;
-
- /**
* Include language attribute in the focus script's <script> element.
This
* property is ignored in XHTML mode.
* @since Struts 1.2
@@ -201,11 +190,6 @@
protected String target = null;
/**
- * The Java class name of the bean to be created, if necessary.
- */
- protected String type = null;
-
- /**
* The name of the form bean to (create and) use. This is either the same
* as the 'name' attribute, if that was specified, or is obtained from the
* associated <code>ActionMapping</code> otherwise.
@@ -321,26 +305,6 @@
}
/**
- * Return the attribute key name of our bean.
- */
- public String getName() {
-
- return (this.name);
-
- }
-
- /**
- * Set the attribute key name of our bean.
- *
- * @param name The new attribute key name
- */
- public void setName(String name) {
-
- this.name = name;
-
- }
-
- /**
* Return the onReset event script.
*/
public String getOnreset() {
@@ -381,26 +345,6 @@
}
/**
- * Return the attribute scope of our bean.
- */
- public String getScope() {
-
- return (this.scope);
-
- }
-
- /**
- * Set the attribute scope of our bean.
- *
- * @param scope The new attribute scope
- */
- public void setScope(String scope) {
-
- this.scope = scope;
-
- }
-
- /**
* Return the style attribute for this tag.
*/
public String getStyle() {
@@ -480,25 +424,6 @@
}
- /**
- * Return the Java class of our bean.
- */
- public String getType() {
-
- return (this.type);
-
- }
-
- /**
- * Set the Java class of our bean.
- *
- * @param type The new Java class
- */
- public void setType(String type) {
-
- this.type = type;
-
- }
// --------------------------------------------------------- Public Methods
@@ -543,26 +468,13 @@
Object bean = pageContext.getAttribute(beanName, scope);
if (bean == null) {
- if (type != null) {
- // Backwards compatibility - use explicitly specified values
- try {
- bean = RequestUtils.applicationInstance(beanType);
- if (bean != null) {
- ((ActionForm) bean).setServlet(servlet);
- }
- } catch (Exception e) {
- throw new JspException(
- messages.getMessage("formTag.create", type, e.toString()));
- }
- } else {
- // New and improved - use the values from the action mapping
- bean =
- RequestUtils.createActionForm(
- (HttpServletRequest) pageContext.getRequest(),
- mapping,
- moduleConfig,
- servlet);
- }
+ // New and improved - use the values from the action mapping
+ bean =
+ RequestUtils.createActionForm(
+ (HttpServletRequest) pageContext.getRequest(),
+ mapping,
+ moduleConfig,
+ servlet);
if (bean instanceof ActionForm) {
((ActionForm) bean).reset(mapping, (HttpServletRequest)
pageContext.getRequest());
}
@@ -776,16 +688,13 @@
focusIndex = null;
mapping = null;
method = null;
- name = null;
onreset = null;
onsubmit = null;
- scope = null;
servlet = null;
style = null;
styleClass = null;
styleId = null;
target = null;
- type = null;
}
@@ -819,19 +728,6 @@
JspException e = new
JspException(messages.getMessage("formTag.mapping", mappingName));
pageContext.setAttribute(Globals.EXCEPTION_KEY, e,
PageContext.REQUEST_SCOPE);
throw e;
- }
-
- // Were the required values already specified?
- if (name != null) {
- if (type == null) {
- JspException e = new
JspException(messages.getMessage("formTag.nameType"));
- pageContext.setAttribute(Globals.EXCEPTION_KEY, e,
PageContext.REQUEST_SCOPE);
- throw e;
- }
- beanName = name;
- beanScope = (scope == null ? "session" : scope);
- beanType = type;
- return;
}
// Look up the form bean definition
1.10 +34 -4
jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedFormTag.java
Index: NestedFormTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/html/NestedFormTag.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- NestedFormTag.java 28 Feb 2003 05:15:06 -0000 1.9
+++ NestedFormTag.java 10 Aug 2003 09:14:04 -0000 1.10
@@ -74,6 +74,36 @@
*/
public class NestedFormTag extends FormTag implements NestedNameSupport {
+
+ //TODO: name property was removed from FormTag but appears to be required
+ // for the nested version to work. See if it can be removed
+ // from here altogether.
+ /**
+ * The name
+ */
+ protected String name = null;
+
+ /**
+ * Return the name.
+ */
+ public String getName() {
+
+ return (this.name);
+
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name The new name
+ */
+ public void setName(String name) {
+
+ this.name = name;
+
+ }
+
+
/**
* Get the string value of the "property" property.
* @return the property property
1.57 +2 -89 jakarta-struts/doc/userGuide/struts-html.xml
Index: struts-html.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- struts-html.xml 11 Jul 2003 04:22:15 -0000 1.56
+++ struts-html.xml 10 Aug 2003 09:14:04 -0000 1.57
@@ -1366,28 +1366,8 @@
the input fields with the current property values from the bean.
</p>
<p>
- The associated form bean is determined in one of two ways:
- </p>
- <ul>
- <li>
- If the <code>name</code> and <code>type</code> attributes
- are not specified, then the form bean will be located, and
- created if necessary, based on the form bean specification
- for the associated <code>ActionMapping</code>.
- </li>
- <li>
- If the <code>name</code> and <code>type</code> attributes
- are specified, then the form bean will be located, and created
- if necessary, using the specified values for <code>name</code>,
- <code>type</code> and <code>scope</code>.
- </li>
- </ul>
- <p>
- <strong>NOTE</strong>: The use of the <code>name</code>,
- <code>type</code> and <code>scope</code> attributes is
- deprecated. The preferred usage is to allow the appropriate
- values to be determined automatically from the corresponding
- <code>ActionMapping</code>.
+ The form bean is located, and created if necessary, based on the
+ form bean specification for the associated
<code>ActionMapping</code>.
</p>
</info>
@@ -1459,31 +1439,6 @@
</attribute>
<attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <info>
- <p>Name of the request scope or session scope bean
- (as defined by the <code>scope</code> attribute)
- whose properties will be used to populate the input
- field values. If no such bean is found, a new bean
- will be created and added to the appropriate scope,
- using the Java class name specified by the
- <code>type</code> attribute.</p>
-
- <p>If this attribute is not specified, the name of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean name will be selected.</p>
- </info>
- <deprecated>
- The bean name will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
-
- <attribute>
<name>onreset</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1501,28 +1456,6 @@
</info>
</attribute>
- <attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <info>
- <p>Scope within which the form bean associated with
- this input form will be accessed or created (must be
- either <code>request</code> or <code>session</code>).
- </p>
-
- <p>If this attribute is not specified, the scope of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean scope will be selected.</p>
- </info>
- <deprecated>
- The bean scope will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
-
<attribute>
<name>scriptLanguage</name>
<required>false</required>
@@ -1574,26 +1507,6 @@
</info>
</attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <info>
- <p>Fully qualified Java class name of the form bean to
- be created, if no such bean is found in the specified
- scope.</p>
-
- <p>If this attribute is not specified, the type of the bean
- will be calculated by using the value of the
- <code>action</code> attribute to look up the
- corresponding <code>ActionMapping</code> element, from which
- the specified form bean type will be selected.</p>
- </info>
- <deprecated>
- The bean type will be determined from the corresponding
- <code>ActionMapping</code>.
- </deprecated>
- </attribute>
</tag>
<tag>
1.19 +0 -17 jakarta-struts/doc/userGuide/struts-nested.xml
Index: struts-nested.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-nested.xml,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- struts-nested.xml 3 Jul 2003 02:10:10 -0000 1.18
+++ struts-nested.xml 10 Aug 2003 09:14:04 -0000 1.19
@@ -918,12 +918,6 @@
</attribute>
<attribute>
- <name>name</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
-
- <attribute>
<name>onreset</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -936,12 +930,6 @@
</attribute>
<attribute>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
-
- <attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -965,11 +953,6 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
- <attribute>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
</tag>
<tag document-attributes="false">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]