From the course: Java EE: JavaServer Faces JSF

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

JSF file upload component

JSF file upload component

From the course: Java EE: JavaServer Faces JSF

Start my 1-month free trial

JSF file upload component

- [Instructor] The JSF file output component is new with JSF 2.2. Prior to this version, you would've had to rely on third party providers like Apache and PrimeFaces or worse raw html to upload files in your JSF application, which is obviously less than ideal. We have a fresh page to work with here. Let's start our work where all JSF input work starts from the h form. So throw in an h form over here on line nine. Open tags, close tags. Now heads up, we need to change the encoding attributes of the h form to support the file output component. So we'll set enctype to multipart forward slash form hyphen data. The multipart slash form data encoding is the best encoding type to transmit binary data over http. This isn't a JSF or java e constraint it's basic http. That being done lets now introduce our file upload components. That's going to be the h inputFile component open and close the tag. Now, I've gone ahead and created a view scope bean named the file upload bean for this exercise…

Contents