File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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.

I agree. Here's the link:
subject: "contype" userAgent in Httprequest
jQuery in Action, 3rd edition