Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.upload
Interface MultipartRequestHandler

All Known Implementing Classes:
  DiskMultipartRequestHandler

public interface MultipartRequestHandler

MultipartRequestHandler provides an standard interface for struts to deal with file uploads from forms with enctypes of "multipart/form-data". Providers must provide a no-argument constructor for initialization.

Author:
  Mike Schachter

Field Summary
`static java.lang.String` | `ATTRIBUTE_MAX_LENGTH_EXCEEDED` This is the ServletRequest attribute that should be set when a multipart request is being read and the maximum length is exceeded.

Method Summary
`void` | `finish()` This method is called on when a successful form post has been made.
`java.util.Hashtable` | `getAllElements()` This method returns all elements of a multipart request.
`java.util.Hashtable` | `getFileElements()` This method is called on to retrieve all the FormFile input elements of the request.
`ActionMapping` | `getMapping()` Get the ActionMapping instance for this request
`ActionServlet` | `getServlet()` Get the ActionServlet instance
`java.util.Hashtable` | `getTextElements()` This method is called on to retrieve all the text input elements of the request.
`void` | `handleRequest(javax.servlet.http.HttpServletRequest request)` After constructed, this is the first method called on by ActionServlet.
`void` | `rollback()` This method is called on when there's some sort of problem and the form post needs to be rolled back.
`void` | `setMapping(ActionMapping mapping)` Convienience method to set a reference to a working ActionMapping instance.
`void` | `setServlet(ActionServlet servlet)` Convienience method to set a reference to a working ActionServlet instance.

Field Detail

### ATTRIBUTE_MAX_LENGTH_EXCEEDED

    public static final java.lang.String ATTRIBUTE_MAX_LENGTH_EXCEEDED

  This is the ServletRequest attribute that should be set when a multipart request is being read and the maximum length is exceeded. The value is a Boolean. If the maximum length isn't exceeded, this attribute shouldn't be put in the ServletRequest. It's the job of the implementation to put this attribute in the request if the maximum length is exceeded; in the handleRequest(HttpServletRequest) method.

  See Also:
    Constant Field Values

Method Detail

### setServlet

    public void setServlet(ActionServlet servlet)

  Convienience method to set a reference to a working ActionServlet instance.

### setMapping

    public void setMapping(ActionMapping mapping)

  Convienience method to set a reference to a working ActionMapping instance.

### getServlet

    public ActionServlet getServlet()

  Get the ActionServlet instance

### getMapping

    public ActionMapping getMapping()

  Get the ActionMapping instance for this request

### handleRequest

    public void handleRequest(javax.servlet.http.HttpServletRequest request)
                       throws javax.servlet.ServletException

  After constructed, this is the first method called on by ActionServlet. Use this method for all your data-parsing of the ServletInputStream in the request

  Throws:
    `javax.servlet.ServletException` - thrown if something goes wrong

### getTextElements

    public java.util.Hashtable getTextElements()

  This method is called on to retrieve all the text input elements of the request.

  Returns:
    A Hashtable where the keys and values are the names and values of the request input parameters

### getFileElements

    public java.util.Hashtable getFileElements()

  This method is called on to retrieve all the FormFile input elements of the request.

  Returns:
    A Hashtable where the keys are the input names of the files and the values are FormFile objects
  See Also:
    `FormFile`

### getAllElements

    public java.util.Hashtable getAllElements()

  This method returns all elements of a multipart request.

  Returns:
    A Hashtable where the keys are input names and values are either Strings or FormFiles

### rollback

    public void rollback()

  This method is called on when there's some sort of problem and the form post needs to be rolled back. Providers should remove any FormFiles used to hold information by setting them to null and also physically delete them if the implementation calls for writing directly to disk. NOTE: Currently implemented but not automatically supported, ActionForm implementors must call rollback() manually for rolling back file uploads.

### finish

    public void finish()

  This method is called on when a successful form post has been made. Some implementations will use this to destroy temporary files or write to a database or something of that nature.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2002 - Apache Software Foundation