servlet
servlet copied to clipboard
Multipart request processing in a Filter should be possible but is not defined
The section on file uploads specifies that the servlet container provides multipart/form-data processing if the Servlet is annotated with @MultipartConfig or the deployment descriptor contains a multipart-config element. Then the Servlet can use the HttpServletRequest getParts and getPart methods.
A Filter should also be able to call getParts but there is no way for a filter to be configured like a Servlet with multiple config markers.
An important use case to point out is providing CSRF protection (typically done with a Servlet) for multipart requests where the filter needs to access information about what parts are submitted in order to validate the request.
- Issue Imported From: https://github.com/javaee/servlet-spec/issues/87
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by rstoyanchev
@glassfishrobot Commented rstoyanchev said: Correction to the above description. I meant to write (replace Servlet with Filter):
"An important use case to point out is providing CSRF protection (typically done with a Filter)..."
@glassfishrobot Commented This issue was imported from java.net JIRA SERVLET_SPEC-87