# Step 8: Run a Web Application

Now you will run the predefined web application WebAppStepTwo. This page flow uses an EJB control to reference the Music bean, and is based on page flow WebAppStepOne_Controls, which you ran in part one of the tutorial. Before you run this page flow, you first might want to examine the structure of this web application.

To Examine the EJB Control

- In the Application pane, double-click WebAppStepTwo, double-click EJBControls, and double-click the EJB control MusicBeanControl.jcx.
- Go to Source View and verify that the control references the Music bean. Notice that this definition is exactly the same as the one used in part one of the tutorial in WebAppStepOne_Controls.

To Examine the Page Flow

- In the Application pane, locate WebAppStepTwo and double-click Controller.jpf. The file opens in Flow View.
- Notice that the page flow begins by going to the JSP page addBand.jsp. Also notice the action addABand, which after executing returns to addBand.jsp. In addition, a selectBand action leads to the JSP page addRecording.jsp. This page invokes the actions addARecording, which returns to the same page, and goToBands, which returns to addBand.jsp.
- (Optional.) Examine the two JSPs and/or the source code of the actions.

To Run the Page Flow

- Make sure that Controller.jpf is opened.
- Click the Start button.
  Workshop launches the Workshop Test Browser.
- Enter a band name and press the Submit button. This will call the Music EJB's addBand method, which will add the band to the database using the Band bean. A listing of known bands appears, which is obtained by calling the getBands method.
- Select a band from the list and add a recording. This will call the Music EJB's addRecording method, which will add the recording to the database via the Band bean and the Entity bean. A new record will contain the title of the recording as well as the recording band. A listing of known recordings appears for the selected band, which is obtained by calling Music bean's getRecordings method.
- Return to WebLogic Workshop and press the Stop button to close the Test Browser.

Related Topics

Tutorial: Java Control

Tutorial: Page Flow

EJB Control

Developing Web Applications

Click one of the following arrows to navigate through the tutorial: