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.

Your first JSF page

Your first JSF page

From the course: Java EE: JavaServer Faces JSF

Start my 1-month free trial

Your first JSF page

- [Instructor] Now let's get about building our first JSF page. We're going to create a page that allows us to enter a name, click on a button, and say hello to that name, displaying a welcome message. This index.xhtml file has been created for us by default by NetBeans. There are already some entries inside this file, we're just going to add a few more items. Let's start with the h:form component. On line nine, we type h:form open tag, and then close tag. I'll add a panel component with the h: panelGrid component for organizing our page elements. So on line 10, we have h:panelGrid open tag, and close tag. Let's set the columns attribute on the h:panelGrid to two, so columns equals two. Inside our panelGrid, let's have an outputLabel component, and set the value attribute. So on line 11, we have h: outputLabel open tag. Let's set the value attribute to "enter a name here". Let's close the tag. Let's throw in an inputText component to accept text input from the user. So on line 12…

Contents