I am having problems using the multi-part form. I started my project on TomEE 1.6, which came with the following JSF implementation:
myfaces-api-2.1.13
myfaces-impl-2.1.13
I read this OK to upgrade JSF on TomEE, so I replaced them with two:
myfaces-api-2.2.0
myfaces-impl-2.2.0
Unfortunately, the multi-part form does not work. When I use a simple form, the Save button correctly switches to the target bean method. As soon as I add enctype="multipart/form-data"to the form tag, the Save button no longer works. The request is sent to the server, but the target method is not called. This basically leads to updating the form with all the lost data.
My faces-config
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
My code
<h:form id="form" enctype="multipart/form-data">
<h:commandButton value="#{messages['common.buttonLabel.save']}" action="#{fileEditBean.save}" rendered="#{fileEditBean.hasSaveAction()}" />
source
share