O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – creating a user registration form

Let's start using PrimeFaces components by creating a simple user registration form, steps for the same are as follows:

  1. Create a User.java POJO (Plain Old Java Object):
    public class User 
    {
      private Integer id;
      private String userName;
      private String password;
      private String firstName;
      private String lastName;
      private String email;
      private String phone;        
      //setters & getters  
    }
  2. Create a JSF managed bean UserController.java, using the following code:
    @ManagedBean @RequestScoped public class UserController { private User registrationUser; public UserController() { this.registrationUser = new User(); } public User getRegistrationUser() { return registrationUser; } public void setRegistrationUser(User registrationUser) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required