= greeter: Demonstrates CDI, JPA, JTA, EJB, and JSF
:author: Pete Muir
:productName: WildFly
:productNameFull: WildFly Application Server
:jbossHomeName: WILDFLY_HOME
:productVersion: 12
:buildRequirements: Java 8.0 (Java SDK 1.8) or later and Maven 3.3.1 or later
include::../shared-doc/attributes.adoc[]

:level: Beginner
:technologies: CDI, JSF, JPA, EJB, JTA
:source: {githubRepoUrl}

[abstract]
The `greeter` quickstart demonstrates the use of CDI, JPA, JTA, EJB and JSF in {productName}.

:standalone-server-type: default
:archiveType: war

== What is it?

The `greeter` quickstart demonstrates the use of CDI, JPA, JTA, EJB and JSF in {productNameFull}.

When you deploy this example, two users are automatically created for you: `emuster` and `jdoe`. This data is located in the `src/main/resources/import.sql file`.

To test this example:

. Enter a name in the *username* field and click on *Greet!*.
. If you enter a username that is not in the database, you get a message `No such user exists!`.
. If you enter a valid username, you get a message `Hello,` followed by the user's first and last name.
. To create a new user, click the *Add a new user* link. Enter the *username*, *first name*, and *last name*, and then click *Add User*. The user is added and a message displays the new user id number.
. Click on the `Greet a user!` link to return to the `Greet!` page.

//*************************************************
// Add notes about use in a production environment.
//*************************************************
:uses-h2:
:uses-ds-xml:
// == Considerations for Use in a Production Environment
include::../shared-doc/development-shortcuts.adoc[leveloffset=+1]

//*************************************************
// Add System Requirements
//*************************************************
// == System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]

//*************************************************
// Add Use of JBoss Home Name
//*************************************************
// == Use of {jbossHomeName}
include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]

//*************************************************
// Start the server with the default profile
//*************************************************
// == Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]

//*************************************************
// Build and deploy the quickstart WAR
//*************************************************
// == Build and Deploy the Quickstart
include::../shared-doc/build-and-deploy-the-quickstart.adoc[leveloffset=+1]

== Access the Application

The application will be running at the following URL: http://localhost:8080/{artifactId}/.

//*************************************************
// Undeploy the quickstart archive
//*************************************************
// == Undeploy the Quickstart
include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1]


== Server Log: Expected Warnings and Errors

You will see the following warnings in the server log. You can ignore these warnings.
----
WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.

HHH000431: Unable to determine H2 database version, certain features may not work
----

//*************************************************
// Add JBoss Developer Studio instructions
//*************************************************
// == Run the Quickstart in Red Hat JBoss Developer Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]

//*************************************************
// Deploy the quickstart to OpenShift
//*************************************************
// == Deploy the Quickstart to OpenShift Online
include::../shared-doc/deploy-to-openshift-online.adoc[leveloffset=+1]

//*************************************************
// Add info to debug the application
//*************************************************
// == Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]
