Description
A request.getInputstream cannot get multipart data from JSF requests when after executing a request.getParameter.
It seems that JSF request is always handled as @MultipartConfig. The process of request.getParameter try to get data from the request.getInputstream even if servlet does not mark the @MultipartConfig. Therefore the application cannot get data from request.getInputstream because the input stream already ended.
https://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-eval-oth-JSpec/servlet-3_0-final-spec.pdf
3.2 File upload
If a request is of type multipart/form-data and if the servlet handling the
request is annotated using the @MultipartConfig as defined in Section 8.1.5,
“@MultipartConfig” on page 8-64, the HttpServletRequest can make available
the various parts of the multipart request via the following methods■ public Collection<Part> getParts()
■ public Part getPart(String name).Each part provides access to the headers, content type related with it and also the
content via the getInputStream method.For parts with form-data as the Content-Disposition, but without a filename,
the string value of the part will also be available via the getParameter /
getParameterValues methods on HttpServletRequest, using the name of the
part.