Page Hit Counter is one of the samples that is shipped with the IBM WebSphere Advanced Edition product. The sample is installed if you selected to install the default resources during the WebSphere Application Server installation. Installing the default resources will also provide an application server called the Default Server.
This tutorial describes how you can use the IBM Distributed Debugger and Object Level Trace (OLT) on the Page Hit Counter servlet by showing screen captures. For more information on the WebSphere Advanced Administrative Console, refer to the IBM WebSphere Application Server Advanced Edition documentation.
Here are the steps:
Start the OLT by typing the following in a system command window:
olt
The following screen will be displayed:
Make sure the Execution mode is Trace and debug. If it is not, select it from the drop down list.
The Debugger hostname is the name of the machine where the Debugger user interface will be displayed. Assuming that the Debugger is installed locally, enter the host name of the machine on which you are working.
Keep 8001 for the Debugger TCP/IP port. Only use another port number if port 8001 is already in use on your machine.
Click Apply.
http://localhost/WSsamples/DB/index.html
Your browser should display this message:
This page has been requested 2 times
There is also a Reload this page and increment the counter button. To rerun the sample, click this button.
OLT will start tracing the events as they take place. Because you have selected Step-by-Step debugging mode, you will be asked if you want to step into every debuggable method.
The first method is the service method of Page Hit Counter servlet and the following dialog box is displayed:
Because OLT is in Step-by-Step debugging mode when it encounters the next debuggable method, it will, again, ask you (using a Method Breakpoints dialog box) if you would like to step into the method.
Because the Page Hit Counter JSP file includes a Page Hit Counter servlet, OLT will ask you to step into the servlet's service method. Highlight the method and click OK as you did for the last method, and the debugger should come up in CounterServlet.java, as follows:
Note: If your browser timed out, see Troubleshooting for instructions on how to increase the browser timeout.
WebSphere Advanced and Advanced Single Server Edition examples