From the course: Java EE: JavaServer Faces JSF

Unlock the full course today

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

Bind components to the backing bean

Bind components to the backing bean

From the course: Java EE: JavaServer Faces JSF

Start my 1-month free trial

Bind components to the backing bean

- [Instructor] All the Facelets components we've seen so far have an honest to goodness java equivalent. That is, for the input text area component for example, there is a class that you can instantiate that will be as good as the Facelets tag that we've defined on our Facelets page. What does that even look like? And why would you want to do that? Let's revisit our input component page. In the backing bean let's define our password field like so, so we have the html input secret password field being the variable name let's fix the import, and then we encapsulate. Refactor, encapsulate fields, we want both the getter and the setter and there. The HTML input secret class is the java equivalent to the HHTML input secret tag, and so it goes for the vast majority of the available JSF components. You can instantiate a java equivalent of most JSF components. To complete the wiring, we need to define a binding on the Facelets page. So we go to our input secret tag on line 13 and the binding…

Contents