org.appfuse.webapp.form
Class UploadForm

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.apache.struts.validator.ValidatorForm
          extended by org.appfuse.webapp.form.BaseForm
              extended by org.appfuse.webapp.form.UploadForm
All Implemented Interfaces:
Serializable

public class UploadForm
extends BaseForm

This class is modeled after the UploadForm from the struts-upload example application. For more information on implementation details, please see that application.

Version:
$Revision: 1.5.2.1 $ $Date: 2006-07-09 13:26:51 -0600 (Sun, 09 Jul 2006) $
Author:
Matt Raible
See Also:
Serialized Form
Form Name:
name="uploadForm"

Field Summary
static String ERROR_PROPERTY_MAX_LENGTH_EXCEEDED
           
protected  FormFile file
          The file that the user has uploaded
protected  String name
          The value of the text the user has sent as form data
 
Fields inherited from class org.apache.struts.validator.ValidatorForm
page, validatorResults
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
UploadForm()
           
 
Method Summary
 FormFile getFile()
          Retrieve a representation of the file the user has uploaded
 String getName()
          Retrieve the name the user has given the uploaded file
 void setFile(FormFile file)
          Set a representation of the file the user has uploaded
 void setName(String name)
          Set the name of the uploaded file (by the user)
 ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
          Check to make sure the client hasn't exceeded the maximum allowed upload size inside of this validate method.
 
Methods inherited from class org.appfuse.webapp.form.BaseForm
equals, hashCode, toString
 
Methods inherited from class org.apache.struts.validator.ValidatorForm
getPage, getResultValueMap, getValidationKey, getValidatorResults, reset, setPage, setValidatorResults
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_PROPERTY_MAX_LENGTH_EXCEEDED

public static final String ERROR_PROPERTY_MAX_LENGTH_EXCEEDED
See Also:
Constant Field Values

name

protected String name
The value of the text the user has sent as form data


file

protected FormFile file
The file that the user has uploaded

Constructor Detail

UploadForm

public UploadForm()
Method Detail

getName

public String getName()
Retrieve the name the user has given the uploaded file

Returns:
the file's name

setName

public void setName(String name)
Set the name of the uploaded file (by the user)

Parameters:
name -

getFile

public FormFile getFile()
Retrieve a representation of the file the user has uploaded

Returns:
FormFile the uploaded file

setFile

public void setFile(FormFile file)
Set a representation of the file the user has uploaded

Parameters:
file - the file to upload

validate

public ActionErrors validate(ActionMapping mapping,
                             HttpServletRequest request)
Check to make sure the client hasn't exceeded the maximum allowed upload size inside of this validate method.

Overrides:
validate in class BaseForm
Parameters:
mapping - The ActionMapping used to select this instance
request - The servlet request we are processing
Returns:
ActionErrors object that encapsulates any validation errors


Copyright � 2002-2006