Home > Apache Geronimo v1.0 > Documentation > Apache Geronimo v1.0 - Developer's Guide > Application frameworks > Struts |
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 http://jakarta.apache.org/struts/ for additional details.
The following software should be installed and configured in order to run the sample covered in this article.
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:
http://java.sun.com
Apache Ant 1.5 or later is required for building the sample application. Ant can be downloaded from the following URL:
http://ant.apache.org
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:
http://struts.apache.org/
All the sample applications covered in this article will be deployed to Apache Geronimo v1.0.
http://geronimo.apache.org/
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 http://ibatis.apache.org/javadownloads.html for additional details.
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.
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.
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.