Hello, how are you?
We are happy for the 100k visitors. To celebrate this mark in this blog we created this post that will show how to create a full web application using the following tools: Tomcat7, JSF2 (Facelets and Libraries) with Primefaces (with AutoComplete), JPA / Hibernate (with a relationship NxN), Login with Filter.
If you want to see a full web application with JSF + EJB + JPA + JBoss 7 click here.
To run the code of this post you will need the artifacts bellow (all jar file you will find in the last page of this post):
You can use the any database you want, you will need the specific driver of the database and to edit the URL connection at the persistence.xml.
At the end of this post you will find the source code with all needed libraries to download.
What you will see today in this post:
- Page 02: Entity classes of the model. A relationship NxN (@ManyToMany), NamedQueries with JoinFetch, Enum as attribute.
- Page 03: Generic DAO, application transaction methods, generic methods to populate query parameters.
- Page 04: Façades an transactions, using the method findReferenceOnly, care using the entityManager.merge() method.
- Page 05: Filters.
- Page 06: ManagedBeans. How to inject a ManagedBean inside another ManagedBean, observations about @ViewScoped.
- Page 07: JSFMessageUtil.
- Page 08: Configurations file: log4j.properties, messages.properties.
- Page 09: xhtml pages, Facelets.
- Page 10: Primefaces AutoComplete, JSF Converter with “forClass”.
- Page 12: “web.xml” configurations.
- Page 13: Increasing the security of your application.
- Page 14: Running the application.
The application that you will find in here will have a Dog and Person CRUD (Create, Read, Update, and Delete); only the ADMIN will have access to the Dog CRUD. Before you run this application you should create a database named “JSFCrudDB”.