The sample applications included as part of the Sun Java (tm) System Application Server
7 are packaged according to a consistent directory structure. This structure
is meant to represent a realistic approach to defining source code workspaces
for J2EE applications. If you are establishing a source code directory
structure for your own J2EE applications, you will find it useful to review
the layout of the sample application source directories and how they are
used in the Ant-based build environment.
The larger sample applications such as Java Pet Store are located directly
under the directory:
install_root/samples/
The balance of the samples are arranged under various categories within
the samples/ directory.
For example, Enterprise Javabean (EJB) samples are collected under:
install_root/samples/ejb/<samplename>/.
For most samples, the following directories and files exist:
Directory or File |
Description |
<sampleroot>/
|
|
<samplename>.(ear|war)
|
Pre-built J2EE EAR/WAR file. |
docs/
|
Sample setup instructions. |
javadocs/
|
Location of Javadoc information when using "ant
javadocs" to generate API documentation for a sample. |
src/
|
Sample source code. Contains J2EE deployment descriptors. |
sql/
|
Database setup scripts and DDL. |
docroot/
|
Web content: JSPs, HTML, images, etc. |
WEB-INF/
|
Tag library definition and resource files. |
<packagename>/
|
Java source code (if any) |
build/
|
Transient build area. |
classes/
|
Class files generated by build facility. |
assemble/
|
Transient assembly area. |
ear/
|
EAR file assembly area. |
war/
|
WAR file assembly area. |
jar/
|
EJB JAR file assembly area. |
Here's a file explorer view
of a sample applications directory:
|