include::../shared-doc/attributes.adoc[]

= greeter: Demonstrates CDI, JPA, JTA, EJB, and JSF
:author: Pete Muir
:level: Beginner
:technologies: CDI, JSF, JPA, EJB, JTA

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

:standalone-server-type: default
:archiveType: war
:uses-h2:
:uses-ds-xml:

== 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.


//*************************************************
// Product Release content only
//*************************************************

ifndef::EAPCDRelease[]

// Considerations for Use in a Production Environment
include::../shared-doc/development-shortcuts.adoc[leveloffset=+1]
// System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]
// Use of {jbossHomeName}
include::../shared-doc/use-of-jboss-home-name.adoc[leveloffset=+1]
// Start the {productName} Standalone Server
include::../shared-doc/start-the-standalone-server.adoc[leveloffset=+1]
// 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
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.

[source,options="nowrap"]
----
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
----

// Run the Quickstart in Red Hat Developer Studio or Eclipse
include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1]
// Debug the Application
include::../shared-doc/debug-the-application.adoc[leveloffset=+1]

endif::[]

//*************************************************
// CD Release content only
//*************************************************

ifdef::EAPCDRelease[]

// Getting Started with OpenShift
include::../shared-doc/cd-openshift-getting-started.adoc[leveloffset=+1]
//Prepare OpenShift for Quickstart Deployment
include::../shared-doc/cd-create-project.adoc[leveloffset=+1]
// Import the Latest {xpaasproduct-shortname} Image Streams and Templates
include::../shared-doc/cd-import-imagestreams-templates.adoc[leveloffset=+1]
// Deploy the {ProductShortName} Source-to-Image (S2I) Quickstart to OpenShift
include::../shared-doc/cd-deploy-project.adoc[leveloffset=+1]
// OpenShift Post Deployment Tasks: This is not currently needed.
// include::../shared-doc/cd-post-deployment-tasks.adoc[leveloffset=+1]

endif::[]

