File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Forcing a page reload (server side) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Forcing a page reload (server side)" Watch "Forcing a page reload (server side)" New topic

Forcing a page reload (server side)

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
Ok... here's the deal. I'm looking to have a web page reload its content from the server no matter what. If the usr comes in for the first time, it obviously goes to the server for data, and displays it. I'm also looking to do this if the user ends up using the back button. I want the page to reload the page from the server side. This will force the page state to be correct. Any ideas in how to do this.

By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Only thing you have is to use no-cache headers on the page, but it probably will not fetch the data with the back button.

You could try to implement some JavaScript detection, but that is very iffy.

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
I work w/a software package from PlanView Inc. that ends up doing this. Not sure how they accomplish this. I was possibly considering putting a javascript page in front of the real page. This javascript page woule redirect to the action which would inturn doing a server call. Not sure if this would work or not.
I agree. Here's the link:
subject: Forcing a page reload (server side)
It's not a secret anymore!