-
Type:
New Feature
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Labels:None
JSF 2.2 introduced the javax.faces.component.HtmlInputFile component and associated h:inputFile component tag. The FacesBridge needs to support this feature in a Portlet 3.0 environment using the new javax.portlet.ClientDataRequest#getPart(String) method.
The javax.servlet.annotation.MultiPartConfig annotation cannot be supported because it is designed to be placed on a servlet class. However, the TCK should test the <multipart-config> element in WEB-INF/web.xml as described in the Java EE 7 Tutorial.
Example Code:
fullPagePostback.xhtml
<h:form enctype="multipart/form-data"> <h:inputFile value="#{backingBean.uploadedPart}" /> <h:commandButton value="Submit" /> </h:form>
xhrPostback.xhtml
<h:form enctype="multipart/form-data"> <h:inputFile value="#{htmlInputFileBacking.uploadedPart}" /> <h:commandButton value="#{i18n['submit']}"> <f:ajax execute="@form" render="@form" /> </h:commandButton> </h:form>
BackingBean.java
import javax.servlet.http.Part; public class BackingBean { private Part uploadedPart; public void setUploadedPart(Part uploadedPart) { this.uploadedPart = uploadedPart; } }
- relates
-
FACES-3036 Support Ajax
-
- Open
-