473,695 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh when user clicks back button

hi,
is there any way to refresh the page when the user clicks back button?I
have a jsp page that i need to regerenate everything everytime the user
visits it.

its either that or i want to disable the back button so to force the
user to click a link so that hte page is refreshed.

If anyone knows how to refresh on back button click or disable the back
button please help me out.

thanks alot
-morc

Feb 10 '06 #1
4 9528
morc wrote:
is there any way to refresh the page when the user clicks back button?
No.
I have a jsp page that i need to regerenate everything everytime the user
visits it.
Tough luck.
its either that or i want to disable the back button so to force the
user to click a link so that hte page is refreshed.


You cannot, which is a Good Thing.
PointedEars
Feb 10 '06 #2


Check in jsp on how to send the client a HTTP HEADER of
"Cache-Control: no-store, no-cache, must-revalidate" for the page
which you wish it be refetched from the server.

Danny
Feb 11 '06 #3
Thomas 'PointedEars' Lahn said the following on 2/10/2006 2:48 PM:
morc wrote:
is there any way to refresh the page when the user clicks back button?


No.


Are you now reversing course from your past behavior of believing that
cache headers can control caching behavior?

If JS is enabled, I *can* force a reload every time the page gets re-loaded.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 14 '06 #4
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 2/10/2006 2:48 PM:
morc wrote:
is there any way to refresh the page when the user clicks back button? No.


Are you now reversing course from your past behavior of believing
that cache headers can control caching behavior?


No, not at all. Not considering that the Cache-Control header would only
work for HTTP/1.1 clients, the following makes it clear that this header is
not a reliable way to force refresh on such an occasion.

,-[RFC2616: HTTP/1.1]
|
| 14.9 Cache-Control
|
| [...]
| Cache-Control = "Cache-Control" ":" 1#cache-directive
|
| cache-directive = cache-request-directive
| | cache-response-directive
| [...]
| cache-response-directive =
| "public" ; Section 14.9.1
| | "private" [ "=" <"> 1#field-name <"> ] ; Section 14.9.1
| | "no-cache" [ "=" <"> 1#field-name <"> ]; Section 14.9.1
| | "no-store" ; Section 14.9.2
| [...]
|
| 14.9.2 What May be Stored by Caches
|
| no-store
| The purpose of the no-store directive is to prevent the inadvertent
| release or retention of sensitive information (for example, on backup
| tapes). The no-store directive applies to the entire message, and MAY
| be sent either in a response or in a request. If sent in a request, a
| cache MUST NOT store any part of either this request or any response to
| it. If sent in a response, a cache MUST NOT store any part of either
| this response or the request that elicited it. This directive applies
| to both non- shared and shared caches. "MUST NOT store" in this context
| means that the cache MUST NOT intentionally store the information in
| non-volatile storage, and MUST make a best-effort attempt to remove the
| information from volatile storage as promptly as possible after
| forwarding it.
|
| Even when this directive is associated with a response, users might
| explicitly store such a response outside of the caching system (e.g.,
| with a "Save As" dialog). History buffers MAY store such responses as
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
| part of their normal operation.
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^
| The purpose of this directive is to meet the stated requirements of
| certain users and service authors who are concerned about accidental
| releases of information via unanticipated accesses to cache data
| structures. While the use of this directive might improve privacy in
^^^^^^^^^^^^^^^ ^^^^^^^^^^
| some cases, we caution that it is NOT in any way a reliable or
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^
| sufficient mechanism for ensuring privacy. In particular, malicious
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
| or compromised caches might not recognize or obey this directive,
| and communications networks might be vulnerable to eavesdropping.
If JS is enabled, I *can* force a reload every time the page gets
re-loaded.


This was not about reloading. However (client-side) scripts are very likely
_not_ to be invoked when the Back feature is used. (Which is, for example,
the major drawback of disabling submit buttons after they were activated in
order to prevent repeated submission of identical data.)
HTH

PointedEars
Feb 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4917
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST == "") { include ("InsertRecord.inc"); // Insert new record }
5
8264
by: Scott Lyon | last post by:
I am having a strange problem. The program is a bit complex, but I'll try to simplify what I can. I apologize if this is complicated, but I think this would still be simpler than posting a bunch of source code. If you want me to post code, though, just say so. In a nutshell, I've got an ASP.NET application that has one main ASPX page. On that ASPX page, it has a user control (an ASCX) that displays the actual data and controls I need.
1
1510
by: JBD | last post by:
Hi, I have a button that fires the below sub routine. This works fine if the user clicks the button as they are supposed to, even if they click it repeatedly. However, if you click "refresh" on the browswer, then it duplicates records. I believe this is happening because somehow it isnt doing the first part of my code which is to to an archive update. I can't for the life of me figure out why this happens only when you click refresh on...
3
11263
by: Wei | last post by:
Hi, I have a page written in ASP.net c# witch has a datalist with 200 records (in Itemtemplate). Each record includes nine webcontrol radio buttons as a group. The user will need to check through all 200 records and select the choices by clicking on the radio button. Every time the radio button is clicked, the selected choice needs to be sent to the database. I set the radio button autopostback = "true", therefore each time user clicks...
2
2338
by: Fabiano | last post by:
Hi there, Houston, i have a problem. :O) I have a page tha contains a datagrid and some textboxes. When the user clicks the ADD button, i need to insert the textbox data into a table and then refresh the datagrid data. Ok, but if my user clicks the browser's refresh button the ASP.NET fires the onClick button again, and again and again.
1
6721
by: Badass Scotsman | last post by:
Hello, I have an application which should never allow the back button to be pushed without refreshing the previous page. For example: Step 1: User fills in form.html and presses submit Step 2: User see's results.html and clicks back to amend form
1
2709
by: Ibrahim. | last post by:
Hi, I have a login page, the problem I'm facing is like this; 1. Login page with submit button (being default button); 2. When first time the page is submitted then submit code is called. 3. Again when page refresh is done by (f5) then submit button is fired implicitly.
2
2831
by: entfred | last post by:
I was experimenting with trying to select the same item in a select box twice in a row and found out that you need to do a refresh (view - refresh) in Internet Explorer. This is so you can click on the same item twice "in a row" to select it. Does anyone know how to automatically make a web page do a refresh when the web page loads? This would prevent the user from having to do the refresh, themselves.
6
14856
by: Brian Simmons | last post by:
Hi all, I come from a ColdFusion background, and the majority of the time, here's how we processed a page: 1) The Data entry page would have a submit button which would post to an action page 2) The action page would do the validation and database processing, if successful, the action page would <cflocation(similar to a Response.Redirect or Server.Transfer) to a display page.
0
8553
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8822
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8815
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6483
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5827
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4332
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.