Chapter 3. The contacts-mobile-basic Example
The contacts-mobile-basic example creates a simple mobile web application that stores contacts. It offers CRUD (create, read, update, delete) functionality.
jQuery Mobile is the main framework used to create the user interface of the application. The framework is composed of widgets that enable interactive application pages for mobile devices, and includes items such as headers, buttons and forms.
This chapter examines how to build and deploy the contacts-mobile-basic example, how it uses the jQuery Mobile framework, and how widgets are used.
3.1. Running the Example
The contacts-mobile-basic example is provided as part of the Red Hat JBoss Web Framework Kit distribution. The example can be downloaded from the Red Hat Customer Portal. This section explains how to download, build, and deploy the example.
3.1.1. Obtaining the Example
The contacts-mobile-basic example is available from the Red Hat Customer Portal. It must be downloaded and extracted into a local directory before it can be built.
Procedure 3.1. Obtaining the Example from the Red Hat Customer Portal
- Log into the Red Hat Customer Portal at http://access.redhat.com.
- Locate the downloads for this release version of Red Hat JBoss Web Framework Kit.
- Download the
.zipfile for Red Hat JBoss Web Framework Kit quickstarts, which contains the contacts-mobile-basic example. - Extract the contents of the downloaded
.zipfile to the location where you want to keep the quickstarts source code.
3.1.2. Building the Example
Use Maven to build contacts-mobile-basic locally.
Procedure 3.2. Building contacts-mobile-basic with Maven
- On the command line, navigate to the directory containing the contacts-mobile-basic example.
- Run the following command to build the example:
$mvn clean package
3.1.3. Deploying the Example
Deploy the example to the JBoss EAP server. After deploying the example to the JBoss EAP server, you can view the example in your browser.
Procedure 3.3. Deploying contacts-mobile-basic to the Server
- In the directory containing JBoss EAP, run the following command to start the server:
$./bin/standalone.sh - Open a new command line instance and navigate to the directory containing the contacts-mobile-basic example.
- Enter the following command to deploy the contacts-mobile-basic example:
$mvn jboss-as:deploy - Open a web browser and access the example at http://localhost:8080/jboss-contacts-mobile-basic/.

