Monday, November 23, 2015

Simple JSF Example for Navigation

1:- Manage Bean

package com.test.siddhu;
public class UserBean {
private int userID;
private String firstName;
private String lastName;
private String email;
//This is Action method to add user
public String addUser() {
return "success";
}
public int getUserID() {
return userID;
}
public void setUserID(int userID) {
this.userID = userID;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
2:- faces-config.xml
Image_3

Image_4


Image_5
Error
Image_6
Fill proper Data and click on Add customer Button
Image_7

Image_8

No comments: