• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Google "naviscope". A few years ago it was around for free, and worked well. It's a proxy server that you load on your local machine and it shows you more http header stuff than you can shake a stick at.

--Dale--
 
Bartender
Posts: 3903
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. You can use 'tcpmon' utility from Apache Axis framework. [more details ...]

2. Another option could be to use WebSphere Studio Application Developer and it's excellent 'TCP/IP Monitoring Server' [more details ...]

regards,
MZ
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alec,
I like to use PuTTY to sniff HTTP response headers:

http://www.chiark.greenend.org.uk/~sgtatham/putty/

I learned how to use PuTTY to sniff HTTP request/response when I was reading the O'Reilly book for Struts. It is mentioned somewhere in the introductory chapters. If you install PuTTY then you can configure a session to hit your Tomcat server. Use the PuTTY GUI to configure these settings for your session:

host=localhost
port=8080
protocol=raw
close window on exit: never
You can turn on logging if you want.

Type your HTTP request into a textpad and copy it to get it into your buffer so you can quickly paste it when you open a connection to your server. Something like this:

GET /Beer-v1/form.html HTTP/1.1
Host: www.wickedlysmart.com
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac )S X Mach-O; en-US; rv1.4) Gecko/20030624 Netscape/7.1
Accept: text/html
Accept-Language: en-us
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

Hit the "Open" button on the PuTTY gui to open a connection to your web server.

Paste your request into the window that pops up by right-clicking the mouse
and then hit return a few times (you need a blank line to end the request, I think).

If you set PuTTY to "close window on exit = never" then you will see the HTTP response in the window:

HTTP/1.1 200 OK
ETag: W/"540-1100387127031"
Last-Modified: Sat, 13 Nov 2004 23:05:27 GMT
Content-Type: text/html
Content-Length: 540
Date: Sun, 21 Nov 2004 22:37:40 GMT
Server: Apache-Coyote/1.1

<html>
<body>
<h1 align="center">Beer Selection Page</h1>
<form method="post" action="SelectBeer.do">
Select beer characteristics<p>
Color:
<select name="color" size="1">
<option>light
<option>amber
<option>brown
<option>dark
</select>
<br><br>
<center>
<input type="submit">
</center>
</form>
</body>
</html>
 
crispy bacon. crispy tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic