This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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 http://support.microsoft.com/default.aspx? 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. "Resolution 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"
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.