June 2014
Intermediate to advanced
578 pages
12h 2m
English
JSF developers have waited a long time for a built-in upload component. Until JSF 2.2, the workarounds consisted of using JSF extensions, such as PrimeFaces, RichFaces, and third-party libraries such as Apache Commons FileUpload.
JSF 2.2 comes with an input component dedicated for upload tasks (that renders an HTML input element of type file). This component is represented by the <h:inputFile> tag and it can be used as any other JSF component. The entire list of supported attributes is available at http://docs.oracle.com/javaee/7/javaserverfaces/2.2/vdldocs/facelets/h/inputFile.html, but the most important ones are as follows:
value: This represents the file to be uploaded as a javax.servlet.http.Part object.required: This ...