HTML and CSS Reference
4. protected folder: Contains all of the protected pages. Only authenticated user are able to
access pages inside this folder. Under the protected folder, there are two main folders:
a. pages folder: Contains the protected pages that are accessible by all of the
authenticated users, which are
• bookSearch.xhtml page, which allows the user to search for books.
• bookRequests.xhtml page, which allows the user to see his/her pending, approved,
and rejected book requests.
• admin folder: Contains the admin protected pages, which are accessible only by
administrator users. It has the following pages:
bookAdd.xhtml page, which allows the administrator user to add new books.
userList.xhtml page, which allows the administrator user to list and manage users.
b. views folder: Contains the view fragments that are used by the pages. It contains only
one file ( menu.xhtml ) which renders the side menu.
public folder: Contains all of the public pages that can be accessed by everyone (including
unauthenticated users). Under public folder, there is one main folder ( pages folder)
which contains the application public pages:
a. about.xhtml page, which represents the about page.
b. contactUs.xhtml page, which represents the contact us page.
c. error.xhtml page, which represents the general error page.
d. forbidden.xhtml page, which the forbidden access page.
register.xhtml page, which allows the application user to register.
resources folder: Contains all of the application composite JSF components.
login.xhtml is the application login page.
Now, let's go through the application pages. Mega App uses container-managed security in order to handle
authentication and authorization. Listing 13-23 shows login.xhtml page.
Listing 13-23. login.xhtml Page
<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns=" http://www.w3.org/1999/xhtml "
xmlns:ui=" http://xmlns.jcp.org/jsf/facelets "
xmlns:h=" http://xmlns.jcp.org/jsf/html " >
<form action="j_security_check" method="POST" class="form-center">
Search WWH ::