You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2002/06/25 02:45:42 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html TextareaTag.java SubmitTag.java SelectTag.java RadioTag.java package.html MessagesTag.java LinkTag.java JavascriptValidatorTag.java ImageTag.java HiddenTag.java FrameTag.java CheckboxTag.java ButtonTag.java BaseHandlerTag.java BaseFieldTag.java
husted 2002/06/24 17:45:42
Modified: src/share/org/apache/struts/taglib/html TextareaTag.java
SubmitTag.java SelectTag.java RadioTag.java
package.html MessagesTag.java LinkTag.java
JavascriptValidatorTag.java ImageTag.java
HiddenTag.java FrameTag.java CheckboxTag.java
ButtonTag.java BaseHandlerTag.java
BaseFieldTag.java
Log:
Update JavaDocs for Struts 1.1
Revision Changes Path
1.10 +6 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/TextareaTag.java
Index: TextareaTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/TextareaTag.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TextareaTag.java 11 Dec 2001 17:54:28 -0000 1.9
+++ TextareaTag.java 25 Jun 2002 00:45:41 -0000 1.10
@@ -106,7 +106,7 @@
/**
* Generate the required input tag.
- * [Indexed since 1.1]
+ * Support for indexed since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -115,7 +115,7 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<textarea");
results.append(" name=\"");
- // @since 1.1
+ // @since Struts 1.1
if( indexed )
prepareIndex( results, name );
results.append(property);
1.8 +7 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/SubmitTag.java
Index: SubmitTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/SubmitTag.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SubmitTag.java 11 Dec 2001 17:54:28 -0000 1.7
+++ SubmitTag.java 25 Jun 2002 00:45:41 -0000 1.8
@@ -195,7 +195,8 @@
/**
* Process the end of this tag.
- * Indexed property since 1.1
+ * <p>
+ * Support for Indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -212,7 +213,7 @@
StringBuffer results = new StringBuffer();
results.append("<input type=\"submit\" name=\"");
results.append(property);
- // since 1.1
+ // * @since Struts 1.1
if( indexed )
prepareIndex( results, null );
results.append("\"");
1.11 +7 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/SelectTag.java
Index: SelectTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/SelectTag.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SelectTag.java 11 Dec 2001 17:54:28 -0000 1.10
+++ SelectTag.java 25 Jun 2002 00:45:41 -0000 1.11
@@ -235,7 +235,8 @@
/**
* Render the beginning of this form.
- * Indexed property since 1.1
+ * <p>
+ * Support for indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -244,7 +245,7 @@
// Create an appropriate "form" element based on our parameters
StringBuffer results = new StringBuffer("<select");
results.append(" name=\"");
- // since 1.1
+ // * @since Struts 1.1
if( indexed )
prepareIndex( results, name );
results.append(property);
1.12 +6 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/RadioTag.java
Index: RadioTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/RadioTag.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- RadioTag.java 21 Mar 2002 02:41:20 -0000 1.11
+++ RadioTag.java 25 Jun 2002 00:45:41 -0000 1.12
@@ -177,7 +177,7 @@
/**
* Generate the required input tag.
- * [Indexed property since 1.1]
+ * [Indexed property since Struts 1.1]
*
* @exception JspException if a JSP exception has occurred
*/
@@ -209,7 +209,7 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<input type=\"radio\"");
results.append(" name=\"");
- // @since 1.1
+ // @since Struts 1.1
if( indexed )
prepareIndex( results, name );
results.append(this.property);
1.13 +1 -51 jakarta-struts/src/share/org/apache/struts/taglib/html/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/package.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- package.html 24 Mar 2002 07:14:45 -0000 1.12
+++ package.html 25 Jun 2002 00:45:41 -0000 1.13
@@ -337,57 +337,7 @@
<p>Aside from form processing, the Struts-HTML offers several other tags or
tag properties to help with displaying error messages, messages, maintaining
hyperlinks, and with internationalizing your application.</p>
- <<<<<<< package.html
-<h4><a name="doc.Other.messages">Displaying Messages</a>
- </h4>
-
-<p>Message handling is an important part of any application. These messages
- can be informative messages and/or error messages for the user. Struts
-provides a generalized method for communicating runtime messages to users,
-based on the same technology used to provide internationalization. Messages
-and error messages can both be used by the messages tag.</p>
-
-<p>The messages tag has basically the same functionality as the errors tag,
-but it iterates through the messages so any formatting of messages can
-be done in the JSP page. Also the header and footer for the message tag
-are optional. </p>
-
-<p>By default, the messages tag will iterate through all pending messages.
-You can also specify a property when queuing a message, and then refer to
-that property in the messages tag. In that case, only the message(s) for
-that property will be displayed. This is helpful when you would like to
-place the message for a field next to the actual field.</p>
-
-<p>Messages are often queued in the Action. The variable info is the ActionForm
- corresponding to this Action. :</p>
-
-<pre> <br> ActionMessages messages = new ActionMessages();<br> messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("userForm.insert", info.getUserName()));<br> messages.add("activationDate", new ActionMessage("userForm.active", info.getSubscriptionLength()));<br></pre>
-
-<p>This queues two messages, one is a global message and another for the
-"activationDate" field. To print all the messages together, simply place the
-messages tag anywhere in your JSP.</p>
-
-<pre> <body bgcolor="white"><br> <ul><br> <html:messages id="message"><br> <li><bean:write name="message"/></li><br> </html:messages><br> </ul><br></pre>
-
-<p>Or, you can place specific messages at different locations</p>
-
-<pre> <ul><br> <html:messages id="message" property="<%= org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE %>"><br> <li><bean:write name="message"/></li><br> </html:messages><br> </ul><br> <table><br> <tr><br> <td align="left"><br> <html:text property="username" size="16" maxlength="16"/><br> </td><br> </tr><br> <tr><br> <td align="left"><br> <html:text property="activationDate" size="10" maxlength="10"/><br> <br><br> <html:messages id="message" property="activationDate"><br> <bean:write name="message"/><br><br> </html:messages><br> </td><br> </tr><br> </table><br></pre>
-
-<p>By default, the actual message is retrieved from the application's standard
- message resource. This gives you a master list of the messages used by
- your application, and provides for internationalization. In the code snippet,
- the message corresponding to "userForm.insert" would be retrieved and
- displayed to the user at runtime. </p>
-
-<pre> userForm.insert={0} has successfully been inserted.<br> userForm.active=The account will be active for {0} months.<br></pre>
-
-<p>A header and footer are optional. The header will be rendered before iteration
-begins and the footer will be rendered after iteration is over. If a
-value is not assigned to the attribute, then nothing will be rendered
-for that attribute.</p>
-
-<pre> <html:messages id="message" header="errors.header" footer="errors.footer"><br> <li><bean:write name="message"/></li><br> </html:messages><br><br> errors.header=<h3><font color="red">Validation Error</font></h3><br> You must correct the following error(s) before proceeding:<UL><br> errors.footer=</ul><hr><br></pre>
- =======
+
<h4><a name="doc.Other.messages">Displaying Messages</a>
</h4>
1.4 +6 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/MessagesTag.java
Index: MessagesTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/MessagesTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MessagesTag.java 16 Oct 2001 15:43:58 -0000 1.3
+++ MessagesTag.java 25 Jun 2002 00:45:41 -0000 1.4
@@ -84,9 +84,9 @@
* retrieved from <code>Action.MESSAGE_KEY</code>. This is an alternative
* to the default <code>ErrorsTag</code>.
*
- * @since 1.1
* @author David Winterfeldt
* @version $Revision$ $Date$
+ * @since Struts 1.1
*/
public class MessagesTag extends BodyTagSupport {
@@ -226,7 +226,7 @@
public int doStartTag() throws JspException {
// Were any messages specified?
ActionMessages messages = null;
-
+
if (message != null && "true".equalsIgnoreCase(message))
name = Action.MESSAGE_KEY;
1.23 +9 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/LinkTag.java
Index: LinkTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/LinkTag.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- LinkTag.java 17 Mar 2002 02:49:06 -0000 1.22
+++ LinkTag.java 25 Jun 2002 00:45:41 -0000 1.23
@@ -328,7 +328,8 @@
/**
* Render the beginning of the hyperlink.
- * Indexed property since 1.1
+ * <p>
+ * Support for indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -345,6 +346,7 @@
// Generate the opening anchor element
StringBuffer results = new StringBuffer("<a href=\"");
+ // * @since Struts 1.1
results.append(calculateURL());
results.append("\"");
if (target != null) {
@@ -436,6 +438,7 @@
/**
* Return the complete URL to which this hyperlink will direct the user.
+ * Support for indexed property since Struts 1.1
*
* @exception JspException if an exception is thrown calculating the value
*/
@@ -447,7 +450,7 @@
name, property, scope, transaction);
// if "indexed=true", add "index=x" parameter to query string
- // since 1.1
+ // * @since Struts 1.1
if( indexed ) {
// look for outer iterate tag
1.3 +130 -130 jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
Index: JavascriptValidatorTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JavascriptValidatorTag.java 18 Mar 2002 02:06:41 -0000 1.2
+++ JavascriptValidatorTag.java 25 Jun 2002 00:45:41 -0000 1.3
@@ -58,8 +58,8 @@
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -81,12 +81,12 @@
/**
- * Custom tag that generates JavaScript for client side validation based
- * on the validation rules loaded by the <code>ValidatorPlugIn</code>
+ * Custom tag that generates JavaScript for client side validation based
+ * on the validation rules loaded by the <code>ValidatorPlugIn</code>
* defined in the struts-config.xml file.
*
- * @since 1.1
* @author David Winterfeldt
+ * @since Struts 1.1
*/
public class JavascriptValidatorTag extends BodyTagSupport {
@@ -106,18 +106,18 @@
protected static Locale defaultLocale = Locale.getDefault();
/**
- * The name of the form that corresponds with the action name
+ * The name of the form that corresponds with the action name
* in struts-config.xml.
*/
protected String formName = null;
/**
- * The current page number of a multi-part form.
+ * The current page number of a multi-part form.
*/
protected int page = 0;
/**
- * This will be used as is for the JavaScript validation method name if it has a value. This is
+ * This will be used as is for the JavaScript validation method name if it has a value. This is
* the method name of the main JavaScript method that the form calls to perform validations.
*/
protected String methodName = null;
@@ -136,19 +136,19 @@
* The src attribute for html script element (used to include an external script resource).
*/
protected String src = null;
-
+
/**
- * Gets the key (form name) that will be used
- * to retrieve a set of validation rules to be
+ * Gets the key (form name) that will be used
+ * to retrieve a set of validation rules to be
* performed on the bean passed in for validation.
*/
public String getFormName() {
- return formName;
+ return formName;
}
/**
- * Sets the key (form name) that will be used
- * to retrieve a set of validation rules to be
+ * Sets the key (form name) that will be used
+ * to retrieve a set of validation rules to be
* performed on the bean passed in for validation.
*/
public void setFormName(String formName) {
@@ -156,17 +156,17 @@
}
/**
- * Gets the current page number of a multi-part form.
- * Only field validations with a matching page numer
+ * Gets the current page number of a multi-part form.
+ * Only field validations with a matching page numer
* will be generated that match the current page number.
*/
public int getPage() {
- return page;
+ return page;
}
/**
- * Sets the current page number of a multi-part form.
- * Only field validations with a matching page numer
+ * Sets the current page number of a multi-part form.
+ * Only field validations with a matching page numer
* will be generated that match the current page number.
*/
public void setPage(int page) {
@@ -174,37 +174,37 @@
}
/**
- * Gets the method name that will be used for the Javascript
- * validation method name if it has a value. This overrides
- * the auto-generated method name based on the key (form name)
+ * Gets the method name that will be used for the Javascript
+ * validation method name if it has a value. This overrides
+ * the auto-generated method name based on the key (form name)
* passed in.
*/
public String getMethod() {
- return methodName;
+ return methodName;
}
/**
- * Sets the method name that will be used for the Javascript
- * validation method name if it has a value. This overrides
- * the auto-generated method name based on the key (form name)
+ * Sets the method name that will be used for the Javascript
+ * validation method name if it has a value. This overrides
+ * the auto-generated method name based on the key (form name)
* passed in.
*/
public void setMethod(String methodName) {
this.methodName = methodName;
}
-
+
/**
- * Gets whether or not to generate the static
- * JavaScript. If this is set to 'true', which
+ * Gets whether or not to generate the static
+ * JavaScript. If this is set to 'true', which
* is the default, the static JavaScript will be generated.
*/
public String getStaticJavascript() {
- return staticJavascript;
+ return staticJavascript;
}
/**
- * Sets whether or not to generate the static
- * JavaScript. If this is set to 'true', which
+ * Sets whether or not to generate the static
+ * JavaScript. If this is set to 'true', which
* is the default, the static JavaScript will be generated.
*/
public void setStaticJavascript(String staticJavascript) {
@@ -212,17 +212,17 @@
}
/**
- * Gets whether or not to generate the dynamic
- * JavaScript. If this is set to 'true', which
+ * Gets whether or not to generate the dynamic
+ * JavaScript. If this is set to 'true', which
* is the default, the dynamic JavaScript will be generated.
*/
public String getDynamicJavascript() {
- return dynamicJavascript;
+ return dynamicJavascript;
}
/**
- * Sets whether or not to generate the dynamic
- * JavaScript. If this is set to 'true', which
+ * Sets whether or not to generate the dynamic
+ * JavaScript. If this is set to 'true', which
* is the default, the dynamic JavaScript will be generated.
*/
public void setDynamicJavascript(String dynamicJavascript) {
@@ -230,21 +230,21 @@
}
/**
- * Gets the src attribute's value when defining
+ * Gets the src attribute's value when defining
* the html script element.
*/
public String getSrc() {
- return src;
+ return src;
}
/**
- * Sets the src attribute's value when defining
+ * Sets the src attribute's value when defining
* the html script element.
*/
public void setSrc(String src) {
this.src = src;
}
-
+
/**
* Render the JavaScript for to perform validations based on the form name.
*
@@ -252,17 +252,17 @@
*/
public int doStartTag() throws JspException {
StringBuffer results = new StringBuffer();
-
+
ValidatorResources resources = (ValidatorResources)
pageContext.getAttribute(ValidatorPlugIn.VALIDATOR_KEY, PageContext.APPLICATION_SCOPE);
Locale locale = null;
try {
locale = (Locale) pageContext.getAttribute(Action.LOCALE_KEY, PageContext.SESSION_SCOPE);
- } catch (IllegalStateException e) { // Invalidated session
+ } catch (IllegalStateException e) { // Invalidated session
locale = null;
}
-
+
if (locale == null) {
locale = defaultLocale;
}
@@ -271,28 +271,28 @@
if ((form = resources.get(locale, formName)) != null && "true".equals(dynamicJavascript)) {
MessageResources messages = (MessageResources)
pageContext.getAttribute(bundle, PageContext.APPLICATION_SCOPE);
-
+
List lActions = new ArrayList();
List lActionMethods = new ArrayList();
-
+
// Get List of actions for this Form
for (Iterator i = form.getFields().iterator(); i.hasNext(); ) {
Field field = (Field)i.next();
-
- for (Iterator x = field.getDependencies().iterator(); x.hasNext(); ) {
- Object o = x.next();
-
- if (o != null && !lActionMethods.contains(o)) {
+
+ for (Iterator x = field.getDependencies().iterator(); x.hasNext(); ) {
+ Object o = x.next();
+
+ if (o != null && !lActionMethods.contains(o)) {
lActionMethods.add(o);
}
}
-
+
}
-
+
// Create list of ValidatorActions based on lActionMethods
for (Iterator i = lActionMethods.iterator(); i.hasNext(); ) {
ValidatorAction va = resources.getValidatorAction((String)i.next());
-
+
String javascript = va.getJavascript();
if (javascript != null && javascript.length() > 0) {
lActions.add(va);
@@ -300,67 +300,67 @@
i.remove();
}
}
-
+
Collections.sort(lActions, new Comparator() {
public int compare(Object o1, Object o2) {
ValidatorAction va1 = (ValidatorAction)o1;
ValidatorAction va2 = (ValidatorAction)o2;
-
- if ((va1.getDepends() == null || va1.getDepends().length() == 0) &&
- (va2.getDepends() == null || va2.getDepends().length() == 0)) {
+
+ if ((va1.getDepends() == null || va1.getDepends().length() == 0) &&
+ (va2.getDepends() == null || va2.getDepends().length() == 0)) {
return 0;
} else if ((va1.getDepends() != null && va1.getDepends().length() > 0) &&
(va2.getDepends() == null || va2.getDepends().length() == 0)) {
return 1;
- } else if ((va1.getDepends() == null || va1.getDepends().length() == 0) &&
+ } else if ((va1.getDepends() == null || va1.getDepends().length() == 0) &&
(va2.getDepends() != null && va2.getDepends().length() > 0)) {
return -1;
} else {
return va1.getDependencies().size() - va2.getDependencies().size();
}
}
- });
-
+ });
+
String methods = null;
for (Iterator i = lActions.iterator(); i.hasNext(); ) {
ValidatorAction va = (ValidatorAction)i.next();
-
+
if (methods == null) {
methods = va.getMethod() + "(form)";
} else {
methods += " && " + va.getMethod() + "(form)";
}
}
-
+
results.append(getJavascriptBegin(methods));
-
+
for (Iterator i = lActions.iterator(); i.hasNext(); ) {
ValidatorAction va = (ValidatorAction)i.next();
String jscriptVar = null;
String functionName = null;
-
+
if (va.getJsFunctionName() != null && va.getJsFunctionName().length() > 0) {
functionName = va.getJsFunctionName();
} else {
functionName = va.getName();
}
-
- results.append(" function " + functionName + " () { \n");
+
+ results.append(" function " + functionName + " () { \n");
for (Iterator x = form.getFields().iterator(); x.hasNext(); ) {
- Field field = (Field)x.next();
+ Field field = (Field)x.next();
- // Skip indexed fields for now until there is
+ // Skip indexed fields for now until there is
// a good way to handle error messages (and the length of the list (could retrieve from scope?))
if (!field.isIndexed() && field.getPage() == page && field.isDependency(va.getName())) {
- String message = StrutsValidatorUtil.getMessage(messages, locale, va, field);
- message = (message != null ? message : "");
-
+ String message = StrutsValidatorUtil.getMessage(messages, locale, va, field);
+ message = (message != null ? message : "");
+
jscriptVar = getNextVar(jscriptVar);
-
- results.append(" this." + jscriptVar + " = new Array(\"" + field.getKey() + "\", \"" + message + "\", ");
-
+
+ results.append(" this." + jscriptVar + " = new Array(\"" + field.getKey() + "\", \"" + message + "\", ");
+
results.append("new Function (\"varName\", \"");
-
+
Map hVars = field.getVars();
// Loop through the field's variables.
for (Iterator iVars = hVars.keySet().iterator(); iVars.hasNext(); ) {
@@ -368,45 +368,45 @@
Var var = (Var)hVars.get(varKey);
String varValue = var.getValue();
String jsType = var.getJsType();
-
- if (Var.JSTYPE_INT.equalsIgnoreCase(jsType)) {
- results.append("this." + varKey + "=" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "; ");
- } else if (Var.JSTYPE_REGEXP.equalsIgnoreCase(jsType)) {
- results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
- } else if (Var.JSTYPE_STRING.equalsIgnoreCase(jsType)) {
- results.append("this." + varKey + "='" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "'; ");
- // So everyone using the latest format doesn't need to change their xml files immediately.
- } else if ("mask".equalsIgnoreCase(varKey)) {
- results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
- } else {
- results.append("this." + varKey + "='" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "'; ");
- }
+
+ if (Var.JSTYPE_INT.equalsIgnoreCase(jsType)) {
+ results.append("this." + varKey + "=" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "; ");
+ } else if (Var.JSTYPE_REGEXP.equalsIgnoreCase(jsType)) {
+ results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
+ } else if (Var.JSTYPE_STRING.equalsIgnoreCase(jsType)) {
+ results.append("this." + varKey + "='" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "'; ");
+ // So everyone using the latest format doesn't need to change their xml files immediately.
+ } else if ("mask".equalsIgnoreCase(varKey)) {
+ results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
+ } else {
+ results.append("this." + varKey + "='" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "'; ");
+ }
}
-
+
results.append(" return this[varName];\"));\n");
}
}
- results.append(" } \n\n");
+ results.append(" } \n\n");
}
}
if ("true".equals(staticJavascript)) {
results.append(getJavascriptStaticMethods(resources));
}
-
+
if ("true".equals(dynamicJavascript)) {
results.append(getJavascriptEnd());
}
-
+
// Print this field to our output writer
JspWriter writer = pageContext.getOut();
try {
writer.print(results.toString());
} catch (IOException e) {
- throw new JspException(e.getMessage());
+ throw new JspException(e.getMessage());
//throw new JspException(messages.getMessage("common.io", e.toString()));
}
-
+
// Continue processing this page
return (EVAL_BODY_TAG);
@@ -416,7 +416,7 @@
* Release any acquired resources.
*/
public void release() {
- super.release();
+ super.release();
bundle = Action.MESSAGES_KEY;
formName = null;
page = 0;
@@ -430,42 +430,42 @@
protected String getJavascriptBegin(String methods) {
StringBuffer sb = new StringBuffer();
String name = formName.substring(0, 1).toUpperCase() + formName.substring(1, formName.length());
-
+
sb.append("<SCRIPT LANGUAGE=\"Javascript1.1\"");
-
+
if (src != null) {
sb.append(" src=\"" + src + "\"> \n");
} else {
sb.append("> \n");
}
-
+
sb.append("<!-- Begin \n");
- sb.append("\n var bCancel = false; \n\n");
+ sb.append("\n var bCancel = false; \n\n");
if (methodName == null || methodName.length() == 0)
- sb.append(" function validate" + name + "(form) { \n");
- else
- sb.append(" function " + methodName + "(form) { \n");
-
- sb.append(" if (bCancel) \n");
- sb.append(" return true; \n");
- sb.append(" else \n");
-
+ sb.append(" function validate" + name + "(form) { \n");
+ else
+ sb.append(" function " + methodName + "(form) { \n");
+
+ sb.append(" if (bCancel) \n");
+ sb.append(" return true; \n");
+ sb.append(" else \n");
+
// Always return true if there aren't any Javascript validation methods
if (methods == null || methods.length() == 0) {
- sb.append(" return true; \n");
+ sb.append(" return true; \n");
} else {
- sb.append(" return " + methods + "; \n");
+ sb.append(" return " + methods + "; \n");
}
-
- sb.append(" } \n\n");
-
+
+ sb.append(" } \n\n");
+
return sb.toString();
}
-
+
protected String getJavascriptStaticMethods(ValidatorResources resources) {
StringBuffer sb = new StringBuffer();
-
+
sb.append("\n\n");
for (Iterator i = resources.getValidatorActions().values().iterator(); i.hasNext(); ) {
@@ -483,30 +483,30 @@
protected String getJavascriptEnd() {
StringBuffer sb = new StringBuffer();
-
+
sb.append("\n");
sb.append("// End -->\n");
sb.append("</SCRIPT>\n\n");
-
+
return sb.toString();
- }
+ }
/**
- * The value <code>null</code> will be returned at the end of the sequence.
+ * The value <code>null</code> will be returned at the end of the sequence.
* ex: "zz" will return <code>null</code>
- */
+ */
private String getNextVar(String input) {
if (input == null) {
return "aa";
}
-
+
input = input.toLowerCase();
-
+
for (int i = input.length(); i > 0; i--) {
- int pos = i - 1;
-
+ int pos = i - 1;
+
char c = input.charAt(pos);
c++;
-
+
if (c <= 'z') {
if (i == 0) {
return c + input.substring(pos, input.length());
@@ -518,13 +518,13 @@
} else {
input = replaceChar(input, pos, 'a');
}
-
+
}
-
+
return null;
-
+
}
-
+
/**
* Replaces a single character in a <code>String</code>
*/
@@ -538,5 +538,5 @@
}
}
-
+
}
1.16 +7 -7 jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java
Index: ImageTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ImageTag.java 13 Jan 2002 03:38:38 -0000 1.15
+++ ImageTag.java 25 Jun 2002 00:45:41 -0000 1.16
@@ -89,7 +89,7 @@
// ------------------------------------------------------------- Properties
-
+
/**
* The alignment for this image.
*/
@@ -206,7 +206,7 @@
/**
* Process the end of this tag.
- * [Indexed property since 1.1]
+ * [Indexed property since Struts 1.1]
*
* @exception JspException if a JSP exception has occurred
*/
@@ -218,7 +218,7 @@
String tmp = null;
StringBuffer results = new StringBuffer();
results.append("<input type=\"image\" name=\"");
- // @since 1.1
+ // @since Struts 1.1
if( indexed )
prepareIndex( results, null );
results.append(property);
1.3 +16 -14 jakarta-struts/src/share/org/apache/struts/taglib/html/HiddenTag.java
Index: HiddenTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/HiddenTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HiddenTag.java 17 Mar 2002 01:44:41 -0000 1.2
+++ HiddenTag.java 25 Jun 2002 00:45:41 -0000 1.3
@@ -4,10 +4,10 @@
* $Date$
*
* ====================================================================
- *
+ *
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
@@ -57,7 +57,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.struts.taglib.html;
@@ -85,8 +85,8 @@
*/
public HiddenTag() {
- super();
- this.type = "hidden";
+ super();
+ this.type = "hidden";
}
@@ -113,7 +113,7 @@
/**
* Generate the required input tag, followed by the optional rendered text.
- * Support for <code>write</code> property since 1.1.
+ * Support for <code>write</code> property since Struts 1.1.
*
* @exception JspException if a JSP exception has occurred
*/
@@ -127,7 +127,9 @@
return (EVAL_BODY_TAG);
}
+
// Calculate the value to be rendered separately
+ // * @since Struts 1.1
String results = null;
if (value != null) {
results = ResponseUtils.filter(value);
1.2 +14 -14 jakarta-struts/src/share/org/apache/struts/taglib/html/FrameTag.java
Index: FrameTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FrameTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FrameTag.java 17 Mar 2002 02:49:06 -0000 1.1
+++ FrameTag.java 25 Jun 2002 00:45:41 -0000 1.2
@@ -4,10 +4,10 @@
* $Date$
*
* ====================================================================
- *
+ *
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
@@ -57,7 +57,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.struts.taglib.html;
@@ -104,7 +104,7 @@
* @author Joe Germuska
* @author Craig R. McClanahan
* @version $Revision$ $Date$
- * @since 1.1
+ * @since Struts 1.1
*/
public class FrameTag extends LinkTag {
@@ -221,7 +221,7 @@
*/
public int doStartTag() throws JspException {
- // Print this element to our output writer
+ // Print this element to our output writer
StringBuffer results = new StringBuffer("<frame ");
results.append("src=\"");
results.append(calculateURL());
@@ -263,8 +263,8 @@
results.append(">");
ResponseUtils.write(pageContext,results.toString());
- // Skip the body of this tag
- return (SKIP_BODY);
+ // Skip the body of this tag
+ return (SKIP_BODY);
}
1.11 +7 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java
Index: CheckboxTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/CheckboxTag.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CheckboxTag.java 11 Dec 2001 17:54:28 -0000 1.10
+++ CheckboxTag.java 25 Jun 2002 00:45:41 -0000 1.11
@@ -176,7 +176,8 @@
/**
* Generate the required input tag.
- * Indexed property since 1.1
+ * <p>
+ * Support for indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -185,7 +186,7 @@
// Create an appropriate "input" element based on our parameters
StringBuffer results = new StringBuffer("<input type=\"checkbox\"");
results.append(" name=\"");
- // since 1.1
+ // * @since Struts 1.1
if( indexed )
prepareIndex( results, name );
results.append(this.property);
1.9 +7 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java
Index: ButtonTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ButtonTag.java 11 Dec 2001 17:54:28 -0000 1.8
+++ ButtonTag.java 25 Jun 2002 00:45:41 -0000 1.9
@@ -171,7 +171,8 @@
/**
* Process the end of this tag.
- * Indexed property since 1.1
+ * <p>
+ * Support for indexed property since Struts 1.1
* @exception JspException if a JSP exception has occurred
*/
public int doEndTag() throws JspException {
@@ -189,7 +190,7 @@
if (property != null) {
results.append(" name=\"");
results.append(property);
- // since 1.1
+ // * @since Struts 1.1
if( indexed )
prepareIndex( results, null );
results.append("\"");
1.16 +14 -8 jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java
Index: BaseHandlerTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseHandlerTag.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- BaseHandlerTag.java 13 May 2002 02:38:33 -0000 1.15
+++ BaseHandlerTag.java 25 Jun 2002 00:45:41 -0000 1.16
@@ -109,7 +109,9 @@
// Indexing ability for Iterate
- /** Whether to created indexed names for fields [since 1.1] */
+ /** Whether to created indexed names for fields
+ * @since Struts 1.1
+ */
protected boolean indexed = false;
// Mouse Events
@@ -225,14 +227,18 @@
return (this.tabindex);
}
-// Indexing ability for Iterate [since 1.1]
+// Indexing ability for Iterate [since Struts 1.1]
- /** Sets the indexed value. */
+ /** Sets the indexed value.
+ * @since Struts 1.1
+ */
public void setIndexed(boolean indexed) {
this.indexed = indexed;
}
- /** Returns the indexed value. */
+ /** Returns the indexed value.
+ * @since Struts 1.1
+ */
public boolean getIndexed() {
return (this.indexed);
}
1.12 +7 -6 jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java
Index: BaseFieldTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseFieldTag.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- BaseFieldTag.java 11 Dec 2001 17:54:28 -0000 1.11
+++ BaseFieldTag.java 25 Jun 2002 00:45:41 -0000 1.12
@@ -145,7 +145,8 @@
/**
* Generate the required input tag.
- * Indexed property since 1.1
+ * <p>
+ * Support for indexed property since Struts 1.1
*
* @exception JspException if a JSP exception has occurred
*/
@@ -155,7 +156,7 @@
StringBuffer results = new StringBuffer("<input type=\"");
results.append(type);
results.append("\" name=\"");
- // since 1.1
+ // * @since Struts 1.1
if( indexed )
prepareIndex( results, name );
results.append(property);
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>