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
From the course: Java EE: JavaServer Faces JSF
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introduction to Facelets5m 47s
-
(Locked)
ViewAction and common properties5m 14s
-
(Locked)
Common input text components5m 51s
-
(Locked)
Selection components11m 8s
-
(Locked)
JSF file upload component5m 33s
-
(Locked)
Page layout components4m 54s
-
(Locked)
Display from data structures in Facelets2m 56s
-
(Locked)
Tables in JSF4m 18s
-
(Locked)
Links and buttons2m 59s
-
(Locked)
Display messages4m 48s
-
(Locked)
HTML5 markup and support in JSF7m 45s
-
(Locked)
Bind components to the backing bean3m 13s
-
(Locked)
Expression language in JSF5m 24s
-
(Locked)
Functional programming with EL2m 44s
-
(Locked)
-
-
-
-
-
-