File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Double Refresh of JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Double Refresh of JSPs" Watch "Double Refresh of JSPs" New topic
Author

Double Refresh of JSPs

Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
Hi
I got this problem of my web pages refreshing twice on load
When I have set my browser settings for "Check For newer versions of web page... " to Automatically... I do not get the double refresh problem, but When I have my setting to "On every visit to the page" my Jsps load twice(its like another submit happening after the jsp is loaded... and of course I checked... there is no submit happening in the onLoad function)

Any Pointers
Thanks
Pratik Lohia
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

How are you determining that the page is double-loading?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
Actually I am able to see the double load happen on slower machines, where the browser response is slow. Whenever a page loads, and the user sees it for a coipla seconds, or moves his mouse to perform any action on the page ... and whoosh.... there goes the page again and refreshes.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

That's not something I've ever heard of. Are you sure that it's not just the browser acting badly and redrawing the display, and that a separate request is actually being sent? Are you sure that there's no meta tag or Javascript on the page that could be triggering a reload?
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
I am sure theres none.... but if u wud still like to verify
here is the jsp header code



and here is the snippet of the javascript on loadc function.






load function like


None of the functions that get called internally in the javascript on
load function like changeCategoryType have a submit. They just set the value of the select boxes in the jsp

and as i said in my fisrt message, tht by changing some browser settings the double refreesh does get avoided. But I do not wish to change the browser settings as there are other dependencies in the application for the existing browser settings
[ March 05, 2006: Message edited by: Pratik Lohia ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

but if u wud


If you want people to take the time and help you with your problem, perhaps you could show the courtesy to take the time to type out the complete letters in "you" and "would"?
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
i did not know all these things matter on the ranch...
i would take care of it in the future...
however takin into consideration the way the world wide web functions... it is also about saving time (productive time for every person on the internet) and thats why those shortcuts were there(a lot of u's for you's and wud for would do save some time...dont they?;-))) and i assume that nobody would find them rude or incourtous as they are the lingo of the web...
anyways...sir.. .your point is taken and will be adhered to.

and i hope that my question still remains the active thread... and that there is some help and answer for it

[ March 05, 2006: Message edited by: Pratik Lohia ]
[ March 05, 2006: Message edited by: Pratik Lohia ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Originally posted by Pratik Lohia:
i did not know all these things matter on the ranch...


They do. Please read this.

it is also about saving time (productive time for every person on the internet)


No, lazy typing like that is about saving your time at the expense of people who have to take the time to decipher the gibberish.

and i assume that nobody would find them rude or incourtous


Incorrect. I find it highly rude and discourteous. It's one thing to make such shortcuts in a chat room or when text messaging on a cell phone, but in a venue such as this where you compose the messages before posting them, it's just lazy and discourteous.

your point is taken and will be adhered to.


Thank you.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

The JSP source is considerably less helpful and interresting than would be the composed HTML sent to the browser. Why not post that?

Also, have you observed this in more than one browser?

Another hint: clicking the 'disable smilies' checkbox when posting code is always a good idea.
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
I have tried it on other browsers like opera and mozilla. it works fine there
[ March 06, 2006: Message edited by: Pratik Lohia ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

So the problem is only observed in IE? Makes me wonder if it's just the browser flickering the display for some reason.

Have you determined whether this could be the case? Or are you certain that two requests are being made to the server?
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
I am certain it is not browser flickering... because if that were the case the changing of settings would not have stopped it from happening. Secondly, I the case of double submit also has been investigated. Even that does not seem to be the issue. There are no double requests being submitted at the browser
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

OK, then it's clearly a browser issue. At this point I'm moving this over to HTML forum. I'd suggest that you post a reply showing the HTML generated for your page (not the JSP source) to see if anyone there can tell what's making IE act so weird.
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
Anyone who knows wats wrong?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

No one has a crystal ball to my knowledge. Please post the generated HTML as I requested.
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
The problem was actually with the way the select boxes were populated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Double Refresh of JSPs
 
Similar Threads
Clean out Form for page refresh
Form getting resubmit on Rfreshing the browser
Double submit problem
Refresh problem in applet
how can I stop the submit being processed twice?