hirondelle.fish.exercise.fileupload
Class FileUploadFilter
Object
hirondelle.fish.exercise.fileupload.FileUploadFilter
- All Implemented Interfaces:
- Filter
public final class FileUploadFilter
- extends Object
- implements Filter
Wrap the underlying request using
FileUploadWrapper
,
such that a file upload can be handled in the same way as a regular form.
The Servlet API does not treat forms which include a file upload control
the same as other forms. In particular, the return value for
request.getParameter(String) is always null for file upload forms.
When this filter is configured for an underlying POST which includes one or more files,
then the application can proceed in much the same way as a regular form.
An exception is that the request requires a cast to the specific wrapper class
in order to access file-related data. Accessing 'regular' data, however,
proceeds normally.
This filter should be configured only for those operations that use a
file upload request.
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUploadFilter
public FileUploadFilter()
init
public void init(FilterConfig aConfig)
throws ServletException
- Specified by:
init
in interface Filter
- Throws:
ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface Filter
doFilter
public void doFilter(ServletRequest aRequest,
ServletResponse aResponse,
FilterChain aChain)
throws IOException,
ServletException
- Specified by:
doFilter
in interface Filter
- Throws:
IOException
ServletException
Copyright Hirondelle Systems - Generated 2013Oct19.12.26