Supercharge your managed beans by injecting dependencies and container-provided components into managed beans.
- [Instructor] Let's look at some of the dependencies…we can inject into our managed beans,…starting with the managed beans themselves.…That's right.…We can inject managed beans into other managed beans.…Now, in earlier version of JSF, server version 2.0,…there were rules about what beans could be injected…into what scopes, et cetera, et cetera, et cetera.…With CDI, most of those rules are gone.…We need only to find the field we want to inject…the component into, and add the @Inject annotation.…
Let's see that in practice.…Now, on line 23,…we will @Inject…our SimpleViewScoped into a field named…viewBean.…Let's fix the imports.…Let's just SampleViewScopedBean.…Fix the imports.…Now, let's try and use the field…from our SampleViewScopedBean.…
I will use the list of dogs we created earlier,…inside our request scoped bean.…So, where we're transmitting the flash variable, recall…that I will replace that with the dog breed…from that bean.…Get the list of dogs, and get the first one.…Let's save that, and see it in action.…
- Why use JSF?
- How JSF works
- Using managed beans in JSF
- Building a JSF page using Facelets
- Using Ajax support in JSF
- Processing complex data with JSF converters
- Security in JSF
- JSF and third-party component libraries
Skill Level Beginner
1. Web Application Development in JavaEE
2. Build Your First JSF Page
3. Use Managed Beans in JSF
4. Build a JSF Page Using Facelets
5. Use Ajax Support in JSF
6. Process Complex Data with JSF Converters
7. Protect Your Application with JSF Validation
8. Security in JSF
9. Combine JSF with Other Frameworks
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.