This is quite easy to add PrettyFaces in your existing JSF projects. By using PrettyFaces we can replace ugly URLs: “/faces/page.jsf” with pretty, SEO-friendly, human URLS: “/optimized/page/”; The client browser never sees your original URLs, even in the source-HTML. PrettyFaces solves several problems elegantly, such as: custom URL-rewriting, page-load actions, seamless integration with JSF navigation and links, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other JSF frameworks.
Category Archives: JSF 2.0
This example shows how to develop a simple CRUD (Create Read Update Delete) by using JSF2, Hibernate and MySQL.
This application lets you manage customer database such as add new customer and update/delete customer info.
Suppose you have two jsf pages, one for inserting record and other for updating and you want to redirect the both pages to confirm page before actually processing the business logic. In confirm page you have to decide two alternative action based on which page the confirm page redirected from.
Using context-param in web.xml we can declare some constant values which will be used by JSF 2 Application.
In this tutorial we are going to show you how to get web application context parameter values in JSF 2 application by using the following two ways-
f:ajax tag adds Ajax functionality to any UI component without additional coding and configuration.
Facelet code can be reused by using composite components-a new feature of jsf 2.0. Also we can pass arguments to composite components.
Templating helps to avoid repetition in facelets pages. This used to create layout and styling for web application. By using facelets tags one can create web interface layout easily.
actionListener in Facelets we ensure buttons affect only the UI.
<h:commandButton actionListener="..." .../>
We usually want this process to occur before beans are populated and especially before validation occurs.
Using this approach we can write our own validator methods. Our custom method will throw a ValidatorException with a FacesMessage if validation fails and do nothing if validation succeeds.
This approach applies to sees if value passes rule of validator after checking required (requiredMessage) and type (converterMessage) and if not, stores error message and redisplays the form that use
validatorMessage attribute to display the customized validator message.