Java Reference
In-Depth Information
33.9
What is the name space for JSF tags with prefix h and prefix f ?
Check
33.10
Point
Describe the use of the following tags?
h:form , h:panelGroup , h:panelGrid , h:inputText , h:outputText ,
h:inputTextArea , h:inputSecret , h:outputLabel , h:outputLink ,
h:selectOneMenu , h:selectOneRadio , h:selectManyCheckbox ,
h:selectOneListbox , h:selectManyListbox , h:selectItem , h:message ,
h:dataTable , h:columm , h:graphicImage
33.4 Processing the Form
Processing forms is a common task for Web programming. JSF provides tools for
processing forms.
Key
Point
The preceding section introduced how to display a form using common JSF elements. This
section shows how to obtain and process the input.
To obtain input from the form, simply bind each input element with a property in
a managed bean. We now define a managed bean named registration as shown in
Listing 33.5.
L ISTING 33.5
RegistrationJSFBean.java
1 package jsf2demo;
2
3 import javax.enterprise.context.RequestScoped;
4 import javax.inject.Named;
5
6 @Named(value = "registration" )
7 @RequestScoped
8 public class RegistrationJSFBean {
9
managed bean
request scope
private String lastName;
property lastName
10
private String firstName;
11
private String mi;
12
private String gender;
13
private String major;
14
private String[] minor;
15
private String[] hobby;
16
private String remarks;
17
18 public RegistrationJSFBean() {
19 }
20
21
public String getLastName() {
22
return lastName;
23 }
24
25
public void setLastName(String lastName) {
26
this .lastName = lastName;
27 }
28
29
public String getFirstName() {
30
return firstName;
31 }
32
33
public void setFirstName(String firstName) {
34
this .firstName = firstName;
35 }
36
 
 
 
Search WWH ::




Custom Search