File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes IE loads the page twice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "IE loads the page twice" Watch "IE loads the page twice" New topic

IE loads the page twice

Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
When I hit my page with IE, it loads the page twice based on the print outs of my app..
I've tried Opera and Mozilla, and they only load the page once.
what can be the cause?
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

When you say "when i hit my page...", are you using a link or submitting a form?
I've encountered behaviour like this in IE when we had dodgy code for submitting the page like this:

and this will submit the request twice!
The hitting the 'submit' button causes a request to be sent, then the submit() in the function causes another request to be sent...
Sean MacLean
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
I've just noticed this issue as well. Don't have a solution but can say that it appears to occur even without javascript. I've only noticed it with Macintosh IE 5.0 build 2022. From the server logs I can see that it is submitting with a post and then a get. It also only seems to happen after a server restart and then the first time you encounter the page.
Sam Cala
Ranch Hand

Joined: Jan 03, 2001
Posts: 147
Check to see guys if you have any html/jsp comment in that page...

Best wishes,
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
When I say "hit" means regular refresh of the website.. The JSP page only contains some html and jsp:include to servlets.
When is say the page is loaded twice, I can only verify that the SERVLETS are loaded twice.. Since the System.out codes are in the servlets.
Here's the headers to my JSP page.

I suspect vp:cacheOff tag might be causing it?
I agree. Here's the link:
subject: IE loads the page twice
It's not a secret anymore!