9. Running and Debugging the Application

In this section you will learn to setup a server and run your web application in a web container. You will also learn how to debug your web application using breakpoints in your web pages.

Background

Workshop offers a powerful JSP debugger that integrates with your existing Eclipse Java debugger. For example you can set a breakpoint in a JSP page, step into the Java implementation of a JSP tag, and then back to the page, and so forth. The IDE can automatically configure, deploy the web application, and start the server for you, or you can attach to an existing server for debugging.

Configure WebLogic Server

In this step you will add a WebLogic Server domain for use with Workshop. This server domain contains runtime libraries required by the application and the application will be deployed to this server.


Run/Debug the Application

Using breakpoints with web pages

  1. Double-click searchResults.jsp in the AppXplorer to open this page in the editor.
  2. In the Source editor, find the line containing the sonic:searchResults tag.
  3. <sonic:searchResults id="results" searchId="search"/>

  4. Right-click in the Source editor markers bar at this line location, and choose the Toggle Breakpoint command.
  5. The markers bar is the gray area at the left side of the Source editor.

  6. In the running web application, click the Rock link under the ‘your favorite music...’ image.
  7. The JSP debugger stops at the breakpoint set above.

  8. Notice that the JSP debugger added a JSP Variables view to the Debug perspective. On the JSP Variables view, expand the Available Variables node.
  9. This node shows the variables accessible by this page regardless of their origin (JSP page, Struts action, and so forth). This saves you time looking for the variables you are using in the page in the application server-specific maps!

  10. Select Run > Step Into, and the Java debugger stops in the doStartTag method of the JSP tag.
  11. Select Run > Step Return, and the control returns to the searchResults.jsp page.
  12. You can now continue stepping or select Run > Resume to resume the web application.
  13. Stop the server by clicking the Stop Server icon on the Console view title bar.

 

Related tasks

Special Considerations When Debugging JSPs

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


Still need help? Post a question on the Workshop newsgroup.