Choose the right short lifespan managed bean in your JSF web application. Discover the purpose of specifically managed bean scopes.
- [Narrator] Now for the short-lived managed beans.…Let's start with a request scope bean.…We've already seen the RequestScoped annotation in action.…This scope specifies that this backing bean class…should be instantiated at the beginning…of a JSF page request and then be destroyed…right after the request is complete,…that is, when the page has completely loaded.…An oversimplified way of thinking of it…is that the bean is created at the beginning…of the JSF request life cycle…and is destroyed after the last step.…
So, this scope is ideal for pages…that will display static information,…or even a page that displays some dynamic data,…but doesn't have too much back and forth…between the user and the server.…Then, we have my favorite, the view scope.…Let's try it out.…We go to our package here.…We create a new Java class.…Let's call this our SampleViewScopedBean.…Hit the finish button.…
There we have our plain Java class.…Let's add the @Named annotation,…fix the import, and then name it the sampleViewBean.…Next, we add our ViewScoped annotation.…
- 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.