NetBeans-SCSNI

4.4-Describe how to monitor HTTP requests when running a web application.

About the HTTP Monitor

The IDE provides the HTTP Monitor to help diagnose problems with data flow from JSP page and servlet execution on the web server. The HTTP Monitor gathers data about HTTP requests that are processed by the servlet engine. For each HTTP request that is processed, the monitor records data about the incoming request and the data states maintained on the server.

You can analyze your HTTP requests, store request records for future sessions, and replay and edit previous HTTP requests. HTTP request records are stored until you exit the IDE, unless you explicitly save them.

By default, the HTTP Monitor starts when you deploy to the Tomcat Web Server. For the Sun Java System Application Server, go to the Services window (Ctrl-5), expand the Servers node, right-click the server's node, choose Properties, and select the Enable HTTP Monitor checkbox.         

Analyzing Session Data

After you have setup the HTTP Monitor, you can use it to debug your web application by observing data flow from your JSP page and servlet execution on the server. The HTTP Monitor records data about each incoming request.

To analyze session data:

  1. Run a web application.
  2. Click the HTTP Monitor.
  3. Select any HTTP request in the tree view to view its information in the display panel.
The HTTP Monitor consists of two panels. On the left is a tree view of HTTP request records. On the right is a display panel that presents the session data associated with the selected HTTP request records.

The tree view

In the tree view, the All Records category contains two subcategories: Current Records and Saved Records. Individual HTTP request records reside in either of these sub-categories. They are accompanied by the following icons:

Icon Description
Get method.
Post method.

Each method icon includes a badge based upon the value of the response status code:

Badge Description
1xx - Information
None 2xx or the value could not be determined.
In the latter case, this normally means that the request has succeeded (200 - OK)
3xx - Warning
400 - Error

The request's method type and status code are also displayed in the display panel's Request tab. A full description of each of the status codes is provided below:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Requests resulting in an internal dispatch cause nested nodes on servers that support this functionality. The forwarded or included requests are nested under the node corresponding to the main requests.

Entries in Current Records are available only during the current IDE session. Current HTTP request records persist across restarts of the server. They are cleared whenever you exit the IDE, or when you explicitly delete them. Entries in Saved Records persist until you delete them. Records in all categories can be sorted according to various criteria using the buttons above the tree view:

Icon Description
Reloads all the HTTP request records stored on the client.
Sorts the HTTP request records by timestamp in descending order.
Sorts the HTTP request records by timestamp in ascending order.
Sorts the HTTP request records alphabetically.
Shows or hides the time stamps in the list of HTTP request records..
tip  If the HTTP Monitor does not show the HTTP request records for a running web module, verify that the monitor is enabled for your web server by right-clicking your web server's node in the Runtime window's Servers node and choosing Properties from the pop-up menu. The Enable HTTP Monitor checkbox should be selected.

The display panel

When you select a HTTP request record in the tree view on the left, the session data corresponding to that HTTP request record appears in the display panel on the right.

-- Wagner R. Santos