Developing Declaratively in JDeveloper

2-2 Web User Interface Developers Guide for Oracle Application Development Framework ■ Viewing ADF Faces source code and Javadoc JDeveloper also includes debugging and testing capabilities. For more information, see the Testing and Debugging ADF Components chapter of the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework.

2.2 Creating an Application Workspace

The first steps in building a new application are to assign it a name and to specify the directory where its source files will be saved. By creating an application using application templates provided by JDeveloper, you automatically get the organization of your workspace into projects, along with many of the configuration files and libraries required by the type of application you are creating.

2.2.1 How to Create an Application Workspace

You create an application workspace using the Create Application wizard. To create an application: 1. In the JDeveloper main menu, choose File New. The New Gallery opens, where you can select different application components to create.

2. In the New Gallery, expand the General node, select Applications and then Java

EE Web Application , and click OK. This template provides the building blocks you need to create a web application that uses JSF for the view and Enterprise JavaBean EJB session beans and Java Persistence API JPA entities for business services. All the files and directories for the business layer of your application will be stored in a project that by default is named Model. All the files and directories for your view layer will be stored in a project that by default is named ViewController.

3. In the Create Java EE Web Application dialog, set a name, directory location, and

package prefix of your choice and click Next. 4. In the Name Your Project page, you can optionally change the name and location for your web project. On the Project Technologies tab, double-click ADF Faces to move that technology to the Selected pane. This automatically adds the necessary libraries and metadata files to your web project. Click Next.

5. In the Configure Java Settings page, optionally change the package name, Java

source path, and output directory for your view layer. Click Next. Note: This document covers only how to create the ADF Faces project in an application, without regard to the business services used or the binding to those services. For information about how to use ADF Faces with the ADF Model layer, the ADF Controller, and ADF Business Components, see the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. For more information about using ADF Faces with the ADF Model layer and EJBs and JPA, see Oracle Fusion Middleware Java EE Developers Guide for Oracle Application Development Framework. Getting Started with ADF Faces 2-3 6. In the Name Your Project page, you can optionally change the name and location for your Java project. By default, the necessary libraries and metadata files for Java EE are already added to your data model project. Click Next. 7. In the Configure Java Settings page, optionally change the package name, Java source path, and output directory for your model layer. Click Next.

8. Configure the EJB settings as needed. For help on this page, click Help or press F1.

Click Finish.

2.2.2 What Happens When You Create an Application Workspace

When you create an application workspace using the Java EE Web Application template, JDeveloper creates a project named Model that will contain all the source files related to the business services in your application. JDeveloper automatically adds the libraries needed for your EJB project. For example, if you kept the default EJB settings, JDeveloper adds the EJB 3.0 library. JDeveloper also creates a project named ViewController that will contain all the source files for your ADF Faces view layer. JDeveloper automatically creates the JSF and ADF configuration files needed for the application. Additionally, JDeveloper adds the following libraries to your view project: ■ JSF 1.2 ■ JSTL 1.2 ■ JSP Runtime The ADF Faces and other runtime libraries are added when you create a JSF page in your project. Once the projects are created for you, you can rename them. Figure 2–1 shows the workspace for a new Java EE Web application.