org.apache.struts.webapp.upload
Class UploadForm

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

public class UploadForm
extends ValidatorForm

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 basic methods to retrieve file information. The actual structure of the FormFile is dependant on the underlying impelementation of multipart request handling. The default implementation that struts uses is org.apache.struts.upload.CommonsMultipartRequestHandler.

Version:
$Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $
See Also:
Serialized Form

Field Summary
protected  String filePath
          The file path to write to
protected  String queryParam
          The value of the embedded query string parameter
protected  FormFile theFile
          The file that the user has uploaded
protected  String theText
          The value of the text the user has sent as form data
protected  boolean writeFile
          Whether or not to write to a file
 
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
 String getFilePath()
          Get the path to write a file to
 String getQueryParam()
          Retrieve the value of the query string parameter
 FormFile getTheFile()
          Retrieve a representation of the file the user has uploaded
 String getTheText()
          Retrieve the value of the text the user has sent as form data
 boolean getWriteFile()
          Get whether or not to write to a file
 void reset()
           
 void setFilePath(String filePath)
          Set the path to write a file to
 void setQueryParam(String queryParam)
          Set the value of the query string parameter
 void setTheFile(FormFile theFile)
          Set a representation of the file the user has uploaded
 void setTheText(String theText)
          Set the value of the form data text
 void setWriteFile(boolean writeFile)
          Set whether or not to write to a file
 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.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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theText

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


queryParam

protected String queryParam
The value of the embedded query string parameter


writeFile

protected boolean writeFile
Whether or not to write to a file


theFile

protected FormFile theFile
The file that the user has uploaded


filePath

protected String filePath
The file path to write to

Constructor Detail

UploadForm

public UploadForm()
Method Detail

getTheText

public String getTheText()
Retrieve the value of the text the user has sent as form data


setTheText

public void setTheText(String theText)
Set the value of the form data text


getQueryParam

public String getQueryParam()
Retrieve the value of the query string parameter


setQueryParam

public void setQueryParam(String queryParam)
Set the value of the query string parameter


getTheFile

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


setTheFile

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


setWriteFile

public void setWriteFile(boolean writeFile)
Set whether or not to write to a file


getWriteFile

public boolean getWriteFile()
Get whether or not to write to a file


setFilePath

public void setFilePath(String filePath)
Set the path to write a file to


getFilePath

public String getFilePath()
Get the path to write a file to


reset

public void reset()

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 ValidatorForm


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.