From the course: Java EE 8 Essential Training
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Templating - Java EE Tutorial
From the course: Java EE 8 Essential Training
Templating
- [Man] Within JSF, we can use the facelets tag library, to introduce templating within our application. This is useful because we can avoid repeating common markup within every page. So, to get started, just right click on the web app folder, and then go to new, other, and then here we're going to create a new XHTML page, we're going to name that page template, and then we'll just hit next, and instead of picking the blank facelet page, we'll select the common facelet page to build out our template, and then just hit finish. You'll notice we're using the older DOCTYPE, so let's go grab out HTML5 DOCTYPE, and we're going to paste that at the top of our file, okay, and now let's take a closer look at our template. So, if we inspect the template, you're going to see these insert tags, that are facelets tags, and basically this is saying that you can define a page title, and insert the content within the template from a…
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.