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

= wicket-ear: Wicket Framework used in a WAR inside an EAR.
:author: Ondrej Zizka <ozizka@redhat.com>
:level: Intermediate
:technologies: Apache Wicket, JPA

[abstract]
Demonstrates how to use the Wicket Framework 7.x with the JBoss server using the Wicket Java EE integration, packaged as an EAR

:standalone-server-type: default
:archiveType: ear

== What is it?

This is an example of how to use Wicket Framework 7.x with WildFly, leveraging features of {javaVersion}, using the Wicket Java EE integration.

Features used:

* Injection of `@PersistenceContext`
* Injection of a value from `web.xml` using `@Resource`
* Injection of a stateless session bean using `@EJB`

This is an EAR version, with the following structure:

[source,options="nowrap"]
----
-`wicket-ear` - parent module
    - `ejb`: Contains EJB beans and JPA entities. Creates a `.jar` file
    - `war`: Contains the Wicket web application, which uses the EJB beans. Creates a `.war` file
    - `ear`: Packages the EJB JAR and WAR into an EAR. Creates an `.ear` file
----

// 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}/

* You will see a page with a table listing the existing Contact entities. Initially, this table is empty.
* Click on the *Insert a new Constact* link to add a new contact.

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

== Debug the Application

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

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