Chapter 3. JSF web application example

Let’s illustrate these ideas with a full example. We’re going to
implement user login/logout for an application that uses JSF. First,
we’ll define a request-scoped bean to hold the username and password
entered during login, with constraints defined using annotations from
the Bean Validation specification: