Java Reference
In-Depth Information
The first thing we need to do is to add an <h:form> tag inside the <f:view> tag. The
<h:form> tag is equivalent to the <form> tag in standard HTML pages. We can either
type the <h:form> tag directly in the page or drag the JSF Form item from the palette
into the appropriate place in the page markup.
If we choose the second approach, the following window will pop-up:
Selecting Empty Form will generate an empty <h:form> tag which we can use to add
our own input fields.
The Form Generated from Entity Class selection is a very nice NetBeans
feature that allows us to generate a form that will include input fields
mapping to all properties in a Java Persistence API ( JPA ) entity. JPA is
covered in detail in Chapter 5.
After adding the <h:form> tag and a number of additional JSF tags, our page now
looks like this:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
Search WWH ::




Custom Search