Part 3: Running the Complete Application

In this section you will open and run the completed application. This application uses all the REST services you created and consumed as data controls.

When t he DeptEmp page runs you'll see the same Department master with Employees as the detail. A button named Edit Selected Employee will navigate to an EditEmployees page where you can modify an employee and save your changes.

Step 1: Open and Run the Completed Client Application

In the next few steps, you'll open the completed client application. The client application will run with your EjbRestService (Model/RestService) application. You MUST have the EjbRestServices (http://localhost:7101/hr-restservice-context-root/resources/tut/department) running for the completed client application to retrieve records.

If they are not started, start both the DepartmentsService and EmployeesService.

  1. Download the completed application zip file and extract to a location that works best for you.

    New option from context menu

     

  2. In JDeveloper, select File > Open and navigate to the directory containing the unpacked sample application zip file content. Open the completed\RestClientApp folder and select the RestClientApp.jws file.

    New option from context menu
  3. In the Application window, expand the ViewController > Web Content > pages and select DeptEmp.jsf.

    Selecting the Page item from the new gallery
  4. Right click the DeptEmp.jsf and from the context menu, select Run.

    Create JSF Page wizard


Step 2: Test the Application

In the next few steps, you examine the completed application and test the REST service functionality.

  1. Once the application opens in the browser it should look very similar to the one you saw upon completion of Part 2: Developing the Client Application, with one difference.

    Dropping data control onto the page

  2. You still have the scrolling between department record, but you should also see a button next to the Employees table label.

    With an employee highlighted in the table, click the Edit Selected Employee button.

    Create dialog
  3. Click the the button and you navigate to a second page which displays the employee details.

    Edit Form Fields dialog
  4. Modify any of the field values, except the employeeId.

    In the image below, the lastName has been modified.

    Edit Form Fields dialog

  5. Then click the Submit button.

    Dropping a data control onto the page

  6. The application will return to the DeptEmp page and the lastName field reflects the change made on the previous page.

    .Dropping a data control onto the page
  7. Close the browser. This part of the tutorial is complete.

     

Bookmark Print Expand all | Hide all
Back to top
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.