Creating a Struts-based Web Application with Oracle ADF

You can create web pages in Model 2 applications that rely on the Struts controller for page navigation in JDeveloper and obtain the advantages of the Oracle Application Development Framework (Oracle ADF) in your application. When you create JSP pages or Oracle ADF UIX pages in a Model 2 application:

Note: If you choose to create a web application that does not rely on a Struts controller, refer to Creating a Model 1 Style Web Page with Oracle ADF.

To create a Model 2 web application using the Struts Page Flow Diagram:

  1. Decide whether you want to work with JSP pages or ADF UIX pages.

    Oracle ADF UIX provides framework features such as event management and true component-based page design.

  2. Create the application workspace using the default Web Application template.

    Hint: To avoid application errors, it is necessary to develop the business services and client application in separate project folders. The JDeveloper application templates will create separate project folders in your workspace.

  3. Create business services for your model project.

  4. Register the business service with the Oracle ADF data controls.

    This allows you to work with the Oracle ADF bindings and easily assemble databound web pages.

    Note: When you work with Oracle ADF Business Components in your model project, you do not need to register the business services. In that case, the design time registers the Business Components application module for you.

  5. Choose a design approach for creating your web pages..

  6. In the ViewController project, open the Struts Page Flow Diagram.

  7. Add a data page to the page flow diagram to provide a starting point for launching the web page.

    The Struts page flow diagram represents the Oracle ADF data page as a Data Page element. The Action element, which also appears on the Component Palette, should not be used in the page flow diagram when you want your web pages to be databound. For details about action mapping using the Oracle ADF data page and other options, see About the Page Flow in Databound Struts Applications.

  8. Design the JSP or ADF UIX page in the JDeveloper Visual Editor using the Data Control Palette.

    You will use the Data Control Palette in JDeveloper to quickly assemble your databound pages. For further suggestions about the pages and Struts page flows you can create, see Designing the User Interface with Oracle ADF Databound Components.

The first time you insert a databound UI component from the Data Control Palette into your web page:

The resulting project files specify the Oracle ADF model layer metadata for the Oracle ADF binding context. These files permit the web application to access the Oracle ADF model layer at runtime. For further details, see About the ADF-Specific Project Files.

After you have created a page flow with at least one data page, right-click the data page that forwards to the desired page and choose Run.


For an overview of Oracle ADF:

To read about Struts and the Page Flow Diagram:

 

Copyright © 1997, 2004, Oracle. All rights reserved.