Packaging: Sample "E"
iPlanetTM
Application Server Samples
Updated June 12, 2001
If you already deployed the packaging sample E, you can run the application
by clicking here.
This samples illustrates
- Packaging of libraries in the form of JAR files in a WAR file.
- Use of property files packaged as part of a WAR
A single EAR file (pkgingE.ear) contains one EJB JAR file (pkgingEEJB.jar) and
one WAR file (pkgingEWAR.war)
File Views for : pkgingEWAR.war,
pkgingEEJB.jar ( 1 and 2
), pkgingE.ear
Component View for all modules.
The sample illustrates the following concepts:
- Cross EJB invocation (within the context of one EJB JAR). The SimpleInterest
and the CompoundInterest beans make calls to each other
- WAR to JAR communication (servlets making calls to EJBs)
- Packaging of libraries in a WAR file
- One JAR file (library.jar) contains samples.pkging.lib.DateLibrary
which is needed by both SimpleInterestServlet and CompoundInterestServlet.
- The library is packaged under WEB-INF/lib/library.jar as required by
spec
- Upon registration, the library is extracted to install_dir/ias/APPS/pkgingE/pkgingEWAR/WEB-INF/lib
- Resource files:
- interest.properties is a resource file that is accessed by servlets.
- The file is packaged as /props/interest.properties
- To access the property file from within a servlet, the following code
is used:
- getServletContext().getResource("/props/interest.properties")
- Upon registration, the resource file is extracted to install_dir/ias/APPS/pkgingE/pkgingEWAR/WEB-INF/props/interest.properties
The rest of the document contains the following sections:
Assembling the Application
Deploying the Application
Running the Application
Assembling the Application
Deploying the Application
Navigate to the directory containing the application's EAR file and run the
iasdeploy
command:
iasdeploy deployapp pkgingE.ear
This command deploys the application to the local machine.
Running the Application
Run the application by accessing the following link:
http://<hostname>:<port>/NASApp/pkgingE/index.html
Choose either "Simple Interest" or "Compound Interest". Enter the values on
the input form and press "Submit". Notice how, on the final page, the application
displays "suggested values" to be used. These values are retrieved from the
property file interest.properties.
If you encounter problems when running the application, review the General
Troubleshooting section to learn how to view logs files.
Copyright
(c) 2001 Sun Microsystems, Inc. All rights reserved.