Create a simple javaee6 web app with maven, glassfish and postgresql
Tech-Today

Create a simple javaee6 web app with maven, glassfish and postgresql


This tutorial creates a simple javaee6 project using eclipse with maven. The application has 1 xhtml page that has a create button, and as you guest it when press will create an Employee record in the database. We use postgresql as the database and glassfish as the container. The models are automatically created using @Entity, @Table annotation.

Important parts of the code:
1.) Eclipse-jee-juno with maven plugin.
  a.) Create a new maven project using quickstart archetype from org.apache.
  b.) You can delete the App.java file.

The sequence can be random, but here is how I add files to the project:

2.) First we add a new source folder src/main/resources and add:
  a.) messages.properties for the localization
  b.) META-INF/ehcache.xml - java based cache
  c.) META-INF/persistence.xml - for hibernate

3.) Add new folder src/main/webapp and inside it add:
  a.) index.xhtml
  b.) WEB-INF/beans.xml - to enable javaee6
  c.) WEB-INF/faces-config.xml
  d.) WEB-INFweb.xml

4.) Your java files should be in src/main/java.

5.) You need to create connection pool and connection data source: http://czetsuya-tech.blogspot.com/2012/05/how-to-create-connection-pool-for.html

6.) Download the entire code here :-)
https://code.google.com/p/czetsuya/source/browse/#svn%2Ftrunk%2Fjavaee6-demo




- Javaee Development
JavaEE6How to create a javaee6 web app using jboss maven war archetypeCreate a simple javaee6 web app with maven, glassfish and postgresqlHow to validate a JavaEE6 Bean in a jobHow to add JavaEE 6 archetypes in eclipse keplerHow to create a custom bean...

- How To Create A Javaee6 Web App Using Jboss Maven War Archetype
This tutorial will teach us how easy it is to create a javaee6 web project using jboss maven archetype. Requirements: 1.) eclipse-jee-juno 2.) maven plugin Steps: 1.) Open eclipse 2.) In eclipse click File->New->Other, and type "maven" in the wizards...

- How To Use Primefaces With Jboss 7.1.3
This tutorial will teach us how to use primefaces with jboss 7.1.3. Requirements:  1.) primefaces 3.5  2.) jboss 7.1.3  3.) maven javaee6 generated project (ear, war, ejb) Steps: 1.) Add primefaces module in jboss.   a.) In JBOSS_HOME/modules...

- How To Create A Connection Pool For Postgresql On Glassfish 3.1.1
This tutorial assumes that 1.) You already have Glassfish 3.1.1 installed. https://blogs.oracle.com/java/entry/glassfish_3_1_1 2.) Create and start a Glassfish domain   a.) asadmin create-domain czetsuya   b.) asadmin start-domain czetsuya...

- How To Setup Findbugs With Maven On Eclipse
Before you proceed with this exercise, it's required to check my blog on how to create a modular maven project. http://czetsuya-tech.blogspot.com/2012/04/how-to-create-modularized-maven-project.html 1.) In this link you will...



Tech-Today








.