HTML and CSS Reference
In-Depth Information
Error Handling
In order to display proper error pages when an error occurs, the following error codes are mapped to the indicated
pages in web.xml as shown in Listing 13-37.
Listing 13-37. Error Codes Mapping in web.xml File
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=" "
xmlns:xsi=" "
xsi:schemaLocation=" "
When error 404 ( Resource not found ) occurs, the user is redirected the login.xhtml page; when error 500
( Internal server error ) occurs, the user is redirected to error.xhtml page; and finally when error 403 ( Forbidden
access ) occurs, the user is redirected to forbidden.xhtml .
Composing JSF Components
In Mega App Facelets pages, there are some cases in which we can create JSF composite components in order to
simplify creating page elements and have the ability to reuse these components in further cases. One of these cases
is the navigation bar which is mentioned in Listing 13-18. In this section, we will create a navigation bar composite
component in order to simply the code of the header page.
<projsfhtml5:navbar> composite component is a wrapper for bootstrap navigation bar that can be used as
shown in Listing 13-38.
Listing 13-38. projsfhtml5:navbar Component
<html xmlns=" "
xmlns:ui=" "
xmlns:projsfhtml5=" " >
Search WWH ::

Custom Search