When you run an application in the development project stage and you encounter an error, you get an error message in an undesirable form. You probably don’t want your users to see that message in such that ugly way. To substitute a better error page, use error-page tag in the web.xml file, in that you can specify either …
JSF 2
JSF 2 SystemEventListener Example
The System Events are normally specified in the JavaServer Faces Specification 2.2 under “System Events” Subject. This concept expands on the idea of lifecycle PhaseEvents. With the PhaseEvents, it is possible to have an application scoped PhaseListeners that are given the opportunity to act on the system before and after each phase in the lifecycle. System events provide a …
JSF 2 @FlowScoped Example
With JSF 2.2, the JavaServer Faces technology allows you to create a set of pages with the new scope FlowScoped, that scope is greater than request scope and less than session scope. The FlowScoped scope depends on the concept of procedure where is declared a well defined entry point and a return value. The entry point should …
JSF 2 ViewScoped Example
View scope was added in the JSF 2.0. A bean in view scope persists while the same JSF view (page) is re displayed. Once the user has navigated into another view the viewscoped bean goes out of scope. If your application has a page has been getting re displayed, then you can put the data …
JSF 2 Flash Scope Example
To minimize session scope bloat, it makes sense to use scope of request as much as possible. Without the redirect element, you can use request scoped beans that are shown in the next view. However, consider what happens with a redirect. The client sends a request to the server. The request scope map is populated …
JSF 2 Redirect Navigation Example
You can configure the JSF configuration to redirect to a new view. Then the JSF implementation sends an HTTP redirect to the client. The redirect response tells the client which URL to use for the next page. The client then makes a GET request to that URL. Redirecting could be very slow some times because another round trip …
JSF 2 Dynamic Navigation using From Outcome Example
In most web applications navigation isn’t static, the page flow doesn’t just depend on which button you click but also on the inputs that you provide. For example, submitting a login page may have two outcomes: success or failure. The outcome depends on a computation-namely, whether the username and password are legitimate. To implement dynamic navigation, …
JSF 2 Ajax Progress Bar Example
One of the major issues that could be cause a headache for the end user when the web application support Ajax, is the indicator of being things are going or happening. Most of web applications doesn’t consider such that indicator, so the end user may submit the form multiple times or canceling it or do …