dgraham 2003/08/16 11:30:27
Modified: src/upload/org/apache/struts/webapp/upload UploadForm.java
Log:
Formatted, replaced ActionError with ActionMessage.
Revision Changes Path
1.9 +21 -21
jakarta-struts/src/upload/org/apache/struts/webapp/upload/UploadForm.java
Index: UploadForm.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/upload/org/apache/struts/webapp/upload/UploadForm.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- UploadForm.java 28 Feb 2003 02:18:23 -0000 1.8
+++ UploadForm.java 16 Aug 2003 18:30:27 -0000 1.9
@@ -61,17 +61,15 @@
package org.apache.struts.webapp.upload;
-
import javax.servlet.http.HttpServletRequest;
-import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
import org.apache.struts.upload.FormFile;
import org.apache.struts.upload.MultipartRequestHandler;
-
/**
* This class is a placeholder for form values. In a multipart request, files are
represented by
* set and get methods that use the class org.apache.struts.upload.FormFile, an
interface with
@@ -82,11 +80,10 @@
* @author Mike Schachter
* @version $Revision$ $Date$
*/
-
-public class UploadForm extends ActionForm
-{
- public static final String ERROR_PROPERTY_MAX_LENGTH_EXCEEDED =
"org.apache.struts.webapp.upload.MaxLengthExceeded";
-
+public class UploadForm extends ActionForm {
+
+ public static final String ERROR_PROPERTY_MAX_LENGTH_EXCEEDED =
+ "org.apache.struts.webapp.upload.MaxLengthExceeded";
/**
* The value of the text the user has sent as form data
@@ -113,8 +110,6 @@
*/
protected String filePath;
-
-
/**
* Retrieve the value of the text the user has sent as form data
*/
@@ -193,16 +188,21 @@
* Check to make sure the client hasn't exceeded the maximum allowed upload
size inside of this
* validate method.
*/
- public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
- {
+ public ActionErrors validate(
+ ActionMapping mapping,
+ HttpServletRequest request) {
+
ActionErrors errors = null;
//has the maximum length been exceeded?
- Boolean maxLengthExceeded = (Boolean)
-
request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
- if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue()))
- {
+ Boolean maxLengthExceeded =
+ (Boolean) request.getAttribute(
+ MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
+
+ if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue())) {
errors = new ActionErrors();
- errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new
ActionError("maxLengthExceeded"));
+ errors.add(
+ ERROR_PROPERTY_MAX_LENGTH_EXCEEDED,
+ new ActionMessage("maxLengthExceeded"));
}
return errors;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]