Another tool that NetBeans provides users without all of the fuss of installing many different plugins and configuration files is the HTTP Server Monitor.
Although basic it mostly covers the main needs of a developer on the day-to-day case.
The NetBeans HTTP Server Monitor helps the developer to interact with HTTP requests, analyze cookies and headers, save and replay sessions, and more.
NetBeans HTTP Monitor is enabled by default if the project is deployed onto Apache Tomcat.
This is a bit different if using GlassFish.
Since we will use GlassFish for this recipe follow the instructions below:
Now follow the steps below to create a project that will be used to demonstrate the HTTP Monitor:
WebApplicationCookbook
and click Next >.When running the application, NetBeans fires up the HTTP Server Monitor (if it's not visible, hit Ctrl+Shift+5). The HTTP Server Monitor is used to analyze the information that is exchanged between the browser and the Application Server in real-time.
On the left-hand side of the panel, under Current Records, are listed the requests made from the client to the browser. By clicking on a request, the information related to that particular request is presented. There are a number of tabs that can be used to filter the information:
It is possible to edit requests and re-use them.
It is also possible to right-click on each individual request and choose Save, Replay, Edit and Replay..., and Delete.
To perform any of these actions, right-click on the request and choose the desired action.
The Save action will move the request from the Current Records folder into the Saved Records:
Replay will re-send the selected request to the server. This is useful when checking the outcome of the selected functionality.
Selecting Edit and Replay..., will let the user edit the request, change parameters, request methods, request URI, and so on before re-sending.
The Edit and Replay tab lets the developer add query parameters simply by clicking the Add Parameter button, then selecting a name and value for the given parameter.
The Request tab gives the developer the power to change the request to one of these three HTTP request methods:
Changing the URI and the Protocol can be done by double-clicking the rightmost part of the parameter in the UI.
This will make the IDE pop up a dialog asking for the corrected value.
The Cookies tab, as with the Query tab, has a very straightforward operation; click on the Add Cookie button and enter the request information to add a cookie to your next request.
The Server tab relates to where the request will be heading. Mostly this information won't change since the development and deployment is done mainly on the localhost machine, but supposing that some machine in the same network might also be holding the application this is where to "redirect" the request to the other machine.
Here Hostname and Port Number of HTTP Service are the options. Double-clicking the rightmost part of the row, denoted by the three dots (...), will display a dialog where the information can be changed.
Various headers are present in the Headers tab and the addition, editing, and deletion of headers is possible.
Both addition and deletion can be executed by the down most buttons and the edition by double-click the rightmost part of the row, denoted by the three dots (…).
Once a request has been edited, just click on Send HTTP Request and the modified request will be on its way.
18.222.167.161