Creating a Split Development Directory Environment 3-9
Figure 3–5 Web Application Source and Build Directories
The key directories and files for the Web application are:
■
helloWebApp\ —The top level of the Web application module can contain JSP files and static content such as HTML files and graphics used in the application.
You can also store static files in any named subdirectory of the Web application for example, helloWebApp\graphics or helloWebApp\static.
■
helloWebApp\WEB-INF\ —Store the Web applications editable deployment descriptor files web.xml and weblogic.xml in the WEB-INF subdirectory.
■
helloWebApp\WEB-INF\src —Store Java source files for Servlets in package subdirectories under WEB-INF\src.
When you build a Web application, the appc Ant task and jspc compiler compile JSPs into package subdirectories under helloWebApp\WEB-INF\classes\jsp_
servlet in the build directory. Editable deployment descriptors are not copied during the build process.
3.3.4 EJBs
EJBs use the source directory layout shown in the figure below.
3-10 Developing Applications for Oracle WebLogic Server
Figure 3–6 EJB Source and Build Directories
The key directories and files for an EJB are:
■
helloEJB\ —Store all EJB source files under package directories of the EJB module directory. The source files can be either .java source files, or annotated
.ejb files.
■
helloEJB\META-INF\ —Store editable EJB deployment descriptors ejb-jar.xml and weblogic-ejb-jar.xml in the META-INF subdirectory of the EJB module
directory. The helloWorldEar sample does not include a helloEJB\META-INF subdirectory, because its deployment descriptors files are generated from
annotations in the .ejb source files. See
Section 3.3.5, Important Notes Regarding EJB Descriptors
. During the build process, EJB classes are compiled into package subdirectories of the
helloEJB module in the build directory. If you use annotated .ejb source files, the build process also generates the EJB deployment descriptors and stores them in the
helloEJB\META-INF subdirectory of the build directory.
3.3.5 Important Notes Regarding EJB Descriptors
EJB deployment descriptors should be included in the source META-INF directory and treated as source code only if those descriptor files are created from scratch or are
edited manually. Descriptor files that are generated from annotated .ejb files should appear only in the build directory, and they can be deleted and regenerated by
building the application.
For a given EJB component, the EJB source directory should contain either:
■
EJB source code in .java source files and editable deployment descriptors in META-INF
or:
Creating a Split Development Directory Environment 3-11
■
EJB source code with descriptor annotations in .ejb source files, and no editable descriptors in META-INF.
In other words, do not provide both annotated .ejb source files and editable descriptor files for the same EJB component.
3.4 Organizing Shared Classes in a Split Development Directory