The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach, a variation of the classic Model-View-Controller (MVC) design paradigm. Refer to for additional details.


The following software should be installed and configured in order to run the sample covered in this article.

J2SE 1.4.2

Geronimo is currently using the Sun ORB for RMI so it is required to use SUN JDK. These sample applications require as a minimum JDK 1.3. Refer to the following URL for details on how to download and install J2SE 1.4.2:

Apache Ant 1.5

Apache Ant 1.5 or later is required for building the sample application. Ant can be downloaded from the following URL:

Struts 1.2.9

Although not required for this particular sample, if you are building your own Struts application you can get Struts 1.2.9 from the following URL:

Apache Geronimo v1.0

All the sample applications covered in this article will be deployed to Apache Geronimo v1.0.

Back to Top

Sample application

In this article we will be exploring Geronimo's Struts support by configuring and deploying the JPetStore 5.0 sample application. JPetStore is a Struts-managed middle tier with iBATIS Database Layer as data access strategy. JPetStore uses the same data model and demo contents as the original, well known, JPetStore; see for additional details.

Back to Top

Configuring the sample application

For this example we will be using the sample's default HSQL database, Apache Geronimo already provides support for this database. The following section describes the steps for defining an HSQL connection pool.

Create a database pool

To create a database in Geronimo follow these steps.

At this point you have created a database connection pool to the Geronimo's embedded HSQLDB database.

Back to Top

Deploy the sample application

In an attempt to demostrate Struts integration with Apache Geronimo we will skip the "build" part for this particular example and we will go stright ahead and deploy the pre-built war. You would normally have to compile the sample application before deployment to include any additional configurations that might be required by the server or the environment in general.

To deploy the sample application run the following command:
<geronimo_home>/bin/deploy --user system --password manager deploy <JPetStore_home>/build/wars/jpetstore.war

Depending on the operating system you are using you should see a message similar to this one:

E:\geronimo\bin>deploy --user system --password manager deploy \apps\JPetStore-5.0\build\wars\jpetstore.war
    Deployed jpetstore @ http://hcunico:8080/jpetstore

Note that for deploying this sample application we have not added any Geronimo specific deployment plans, we just configured a database connection pool.

To test the applicaiton open a web browser and access the following URL: http://localhost:8080/jpetstore

Click on Enter the Store, browse the catalog and place an order.

Back to Top