Handling Form Requests With File Uploads
- Form data encoded with "multipart/form-data" encoding, rather
than "application/x-www-form-urlencoded".
- JSF does not handle multipart/form-data.
- Use a servlet filter that intercepts a file upload and:
- Uses Apache Commons file upload library for decoding the
multipart/form-data request.
- Turns uploaded files into request attributes.
- Turns other form data into request parameters.
- JSF application processes request parameters unaware that they were not
URL encoded originally.
- Here is the servlet filter:
UploadFilter.java