The user first accesses your site through the login page. The user’s email and password are validated against the database in the login servlet. A user email with the correct matching password is presumed to be a valid user. The valid user is retrieved from the database and stored in the User object . Recall that the User object is generated by the “JPA Generate Entities from Tables” option.
A User object that is stored in the session is easily available to every servlet or JSP in your site. The login ...