Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to See the HTTP Message Exchange between browser and Tomcat?

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am studying Servlet and JSP programming. I am using Tomcat in win98. Is
there anyway I can tap the normal HTTP message exchanged between IE and
Tomcat? (for studying purpose e.g. to tell how cookie is used for session
management)

Thx for your advice.
 
Bahadar Khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If by taping you mean to see the information received at Browser and the information posted to Container, then it is simple, see the header information using methods in HttpServletRequest at Container end. And like wise before committing response inspect header inromation using methods in HttpServletResponse. The first case will show you what browser sent and secondly what container sent to browser.

You may use console to print that info.
getHeader("Header-name"); etc etc.
 
louise rochford
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you said IE, but I've found using Firefox as a browser has made it much easier to look at request response stuff from the browser prespective as well.
If you install it in custom mode & get the developer tools you can use HttpHeaders to get a clearer picture of what happens in the handshake process etc.
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx for your answer.

I've got a solution - although a bit sophisticated. I setup another machine to run tomcat and use Ethereal (a protocol analyzer) to monitor the http specific packets passed thru my ethernet card.

Cheers
 
Sundar Murthi
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lee,
Beter than etheral u can also use JPcapDumper its fully java based packaet analyzer same like etheral(it internaly uses same etheral dll files)

The source code also available. U can customize ur capturing packets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic