= tasks-jsf: JSF, JPA quickstart
:author: Lukas Fryc
: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: Intermediate
:technologies: JSF, JPA
:source: {githubRepoUrl}
:prerequisites: link:tasks/README{outfilesuffix}[tasks]

[abstract]
The `tasks-jsf` quickstart demonstrates how to use JPA persistence with JSF as the view layer.

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

== What is it?

The `tasks-jsf` quickstart demonstrates how to use JPA persistence with JSF as view layer in an application deployed to {productNameFull}. It provides a JSF front end for the link:../tasks/README.adoc[tasks] quickstart.

The theme of this application is simple Task management with simple login. The project contains two entities - a `user` and a `task`.

This sample includes a persistence unit and some sample persistence code to introduce you to database access in enterprise Java. Persistence code is covered by tests to help you write business logic without the need to use any view layer.

JSF is used to present the user two views.

* authentication form: This provides the simple login
* task view: This view contains the task list, a task detail, and a task addition form. The task view uses AJAX.

//***************************************
// Add notes about use in a production environment.
//***************************************
// == Considerations for Use in a Production Environment
:uses-h2:
:uses-ds-xml:
:performance-scalability:
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}/.

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


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


//*************************************************
// Run the Arquillian tests
//*************************************************
// == Run the Arquillian Tests
include::../shared-doc/run-arquillian-tests.adoc[leveloffset=+1]

//*************************************************
// 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]

== Debug the Application

If you want to debug the source code of any library in the project, run the following command to pull the source into your local repository. The IDE should then detect it.

[source,options="nowrap"]
----
$ mvn dependency:sources
----
