# Step 13: Run a Web Application

In this step you will run the predefined web application WebAppStepThree. This page flow uses the same EJB control as WebAppStepTwo, and uses the same JSPs and action methods to add bands and recordings and receive listings of bands and recordings. In addition, it is possible to review the rating of a recording.

To Examine the Page Flow

- In the Application pane, locate WebAppStepThree and double-click Controller.jpf. The file opens in Flow View.
- Notice that this page flow also contains the JSP page recordingStats.jsp and the action methods goToStats and goToRecordings.
- (Optional.) Examine the JSP 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.
- On the first page, locate the list of bands that you created in earlier parts of the tutorial, and click a band to go to the recordings of this band. Because the Recordings table was re-created, the recordings that you entered previously are gone.
- Enter a new 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. The record that is added to the database initially contains the title of the recording, the recording band, and the entity relation between the band and recording stored in the BandEJB_name column. In addition, the addRecording method sends a message to the JMS queue. When the Statistics bean receives the message, it will create a rating for this recording and add that to the table via the Recording bean. The operations of a message-driven bean are asynchronous; after the addRecording method sends the message to the JMS queue, control immediately returns to the calling page flow action method addARecording.
- Click a recording to view the rating. This will call the Recording bean's getRating method, which will return a rating, or null if the Statistics bean has not processed the JMS message yet.
- Return to WebLogic Workshop and press the Stop button to close the Test Browser.

Note. If you receive a NamingException when the page flow starts, the EJB container is unable to locate and reference the Recording bean, the JMS provider, and/or the JMS queue. Go back to step 12 of the tutorial to verify the references, and use WebLogic console to verify the JNDI names of the JMS provider and queue. When you make changes to EJBs, you must rebuild these before running the page flow again.

Related Topics

Tutorial: Java Control

Tutorial: Page Flow

EJB Control

Developing Web Applications

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