Request.getParts is called without multiparameter configuration. Either add @MultipartConfig to the servlet or the multipart-config element to web.xml

I would like to use a component component to load JSF files. With AJAX if possible. But I cannot get it to work.


<h:form enctype="multipart/form-data">
    <h:inputFile value="#{bean.file}" required="true"/>
    <h:commandButton action="#{bean.importFile()}"/>


I thought the following error should not be present when using JSF 2.2.


called without multiparameter configuration. Either add a @MultipartConfig

for servlet or multipart-config element for web.xml


  • Glassfish 4.1
  • Mojarra 2.2.4
  • Primefaces 5.0

source to share

1 answer

For some [incomprehensible] reason, @MultipartConfig

which was added in FacesServlet

for JSF-2.2 is not used for you. As a result, you now need to manually add the multipart configuration to your web.xml like so:





All Articles