How do I monitor HTTP communication in Eclipse?
Author: Deron Eriksson
Description: This tutorial shows how to use the TCP/IP Monitor view in Eclipse.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.1 || Tomcat 5.5.20
(Continued from page 1)
If we fire up our web application on the default 8080 port and we try to hit 8080 directly, we should see that the monitor is not hit, since the request went directly to 8080.
As expected, the TCP/IP Monitor shows that it wasn't hit.
Next, let's try hitting port 8081. This should hit the TCP/IP Monitor listening on port 8081, and this should get forwarded to port 8080. TomcatSW should receive the request for the web page and send back the results.
As expected, the monitor now shows the communication between the browser and the local Tomcat application. We can see in the request header that the browser asks localhost:8081 for /java-tutorials/, which returns an htmlW page which is displayed in the bottom right-hand section of the results.
We can see that a cssW file and five graphic files were requested in order to render the html page. If we click on the header.jpg file, we can see that the monitor displays the actual image! In my version of EclipseSW, sometimes the monitor has some trouble display certain images, but in this example, it worked great.
I've seen that in my version of Eclipse, the monitor can sometimes get stuck, and I need to refresh the browser in order for the request to get completed. I wouldn't recommend having the monitor running all the time, but it can be very useful for things such as watching the cookieW communication between your browser and servletW container.