servlet icon indicating copy to clipboard operation
servlet copied to clipboard

Multipart request processing in a Filter should be possible but is not defined

Open glassfishrobot opened this issue 11 years ago • 4 comments

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.

glassfishrobot avatar Jan 30 '14 20:01 glassfishrobot

  • Issue Imported From: https://github.com/javaee/servlet-spec/issues/87
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

glassfishrobot avatar Jun 06 '18 07:06 glassfishrobot

@glassfishrobot Commented Reported by rstoyanchev

glassfishrobot avatar Jan 30 '14 20:01 glassfishrobot

@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 avatar Jan 30 '14 20:01 glassfishrobot

@glassfishrobot Commented This issue was imported from java.net JIRA SERVLET_SPEC-87

glassfishrobot avatar Apr 26 '17 06:04 glassfishrobot