This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Servlets and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark ""contype" userAgent in Httprequest " Watch ""contype" userAgent in Httprequest " New topic

"contype" userAgent in Httprequest

Prabu CBE

Joined: Sep 12, 2002
Posts: 2
I'm using servlets to generate PDF's at runtime and flush them. Bur from Browser(IE 5.5 sp2) the request goes twice to the servlet. As per the link scid=kb;en-us;Q293792
the soln. lies in finding the "contype" userAgent in request. But how to find this?
Following is the excert from that link for soln.
To work around this limitation and to considerably improve the performance of your application, watch for the "contype" userAgent request and only return the content-type"

Thanks in advance.
Bonnie Beach-Morin

Joined: Jun 13, 2002
Posts: 13
The MS article sounds like it's looking for the User-Agent header in the HTTP request. You can access the HTTP headers using the following:

The User-Agent header indicates the client application that is making the request, such as IE or Mozilla.
A good way to find out what information a browser is sending, is to create a basic SnoopServlet that grabs all the headers (using req.getHeaderNames()) and prints them out.
For more information about HTTP headers, see RFC 2616
Hope this helps.

It is sorta covered in the JavaRanch Style Guide.
subject: "contype" userAgent in Httprequest
It's not a secret anymore!