Two Laptop Bag
The moose likes Servlets and the fly likes IE call the servlet multiple times Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "IE call the servlet multiple times" Watch "IE call the servlet multiple times" New topic

IE call the servlet multiple times

Myria Ben

Joined: Jan 04, 2005
Posts: 4
I call servlet (by IE6.0) one times but IE call servlet for me 2 times.

I've set my servlet to these below already but still have this problem.

int cacheExpiringDuration = 5000; //so much long time 5000 secs
response.setDateHeader("Expires", System.currentTimeMillis() + cacheExpiringDuration * 1000);

and I call by this url:

Anybody can help me pls. :roll:

Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Do you log the exact URL the browser is fetching? Browsers often generate an extra request for a file "favicon.ico" to show next to the URL in the address bar.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
I seem to remember hearing something about this problem before. Something about one call to get the size and the second to get the content.
Are you setting the content-length in the response?
Myria Ben

Joined: Jan 04, 2005
Posts: 4
My servlet is already set by these.

response.setHeader("Content-Disposition", "inline;filename=\"" + System.currentTimeMillis() + ".pdf\"");

How do I do about favicon.ico?
I agree. Here's the link:
subject: IE call the servlet multiple times
It's not a secret anymore!