JSF 2, Spring 4, Hibernate 4 and Maven Integration

In this tutorial I will show you how to integrate JSF 2, Spring 4, Hibernate 4 and Maven. In the previous example Spring 3, JSF 2 and Hibernate 3 integration example , I have shown how to integrate JSF 2, Spring 3 and Hibernate 3 but I have not used maven there. For this tutorial we will create maven based web project in Eclipse. If you already have an idea on how to create a maven project in Eclipse will be great otherwise I will tell you here how to…

Continue

Immediate attribute example in JSF

Introduction This tutorial will show you what is the purpose of using immeditae attribute in JSF. Although the request processing lifecycle processes the different phases in a consistent manner, the execution order of the phases can be altered for special cases. For example, you may want to add a Cancel button to a form. When clicked, it will skip all validation and simply navigate to another page without processing the values in a form. To alter the processing order of the request processing lifecycle, simply set the immediate attribute on…

Continue

Life cycle of JavaServer Faces (JSF)

In Java Server Faces (JSF) the client makes an HTTP request for the page, and the server responds with the page translated to HTML. However, the Java Server Faces life cycle is split up into multiple phases in order to support the sophisticated UI (User Interface) component model. This model requires that component data be converted and validated, component events be handled, and component data be propagated to beans in an orderly fashion. A Java Server Faces page represented by a tree of UI components, called a view. During the…

Continue

Google Pie Chart using JSF

Introduction I will show you how to create Google chart using JSF 2. I will create here pie chart. The Google chart basically displays different statistical data on different chart types such as column chart, bar chart, line chart, pie chart etc. You can have a look at the URL https://developers.google.com/chart/ for more information. You can integrate Google chart with any server side technology but here I will show you how to integrate Google chart using JSF. This tutorial shows step by step so that you can understand how it…

Continue

JSF 2 Internationalization example

This tutorial JSF 2 internationalization example shows how you make an web based application in different languages. I will show here how you can switch in different languages like Bengali, Hindi, English, Dutch and French. You don’t need to change the language settings from the browser for switching to different languages. I have given user an option to choose a language in a dropdown where the languages are displayed in Bengali, Hindi, English, Dutch and French. If you want you can add more languages and accordingly you need to create…

Continue

Effective pagination example in jsf 2

Introduction In this tutorial I will show how to create effective pagination example in jsf 2, hibernate and in-memory database – hsqdb . In memory database like hsqldb is good when you want to do some quick POC or testing the application without setting up a large database. There are lots of built-in API for datatable paginations like PrimeFaces, RichFaces, Openfaces, SmartFaces, ICEFaces etc. but if someone wants to create his/her own application’s pagination then it might be useful at least for beginners.

Continue

File upload example in JSF 2

Introduction Here we will see file upload example in jsf 2. The file upload implementation in Java based web application is very complex and we need to be dependent on Apache file upload libraries. When we work on JSF(Java Server Faces), we have jsf pages with other inputs along with file inputs on the web page, so integration with Apache file upload libraries make more complex or else we have to be dependent on some third party file upload components like primefaces, richfaces etc. Servlet 3.0 is part of Java…

Continue

ValueChangeListener example in JSF 2

Introduction This tutorial shows how to use ValueChangeListener to create dependent dropdown in JSF 2 and MySQL. I have used here JSF 2’s valueChangeListener which fires value change event when select option dropdown gets changed. Any component that receives user input, such as one of the HTML select or text input components, can publish value change events. The dependent dropdowns or cascaded dropdowns are useful when you have the requirements for selecting dropdown’s value based one another dropdown’s value. For example, you may have requirement to select country name based…

Continue