I have two Tomcat servers on my machine that communicate with one another.
1) Can someone recommend on a good (free) network sniffer so I'll be able to monitor the requests/ response that being sent between them?
2) How can I inspect the request in java code? to see what the header and the body consists and their structures?
thanks a lot, from some reason #2 is not as straight forward as i thought it would be.
Me
I like Wireshark.
If you're on Windows, you can't directly monitor the 127.0.0.1 loopback. You will need to set up an alternate loopback adapter (the same functionality on another address). This is detailed in the Wireshark docs:
http://wiki.wireshark.org/CaptureSetup/Loopback
I'm not sure what you mean by your second question, can you go into more detail?
If all your requests are HTTP-based, then Wireshark will be able to show the headers and body data, but it's outside the context of the Java code.