How to prevent going back to the previous page by hitting the Back button ?
In the html code I generate from my servlet, I have the following :
<Html>
<Head>
<Title>Cox Part Time Benefit App Login Page</Title>
<Meta http-equiv="Pragma" content="no-cache">
<!-- Pragma content set to no-cache tells the browser not to cache the page. This may or may not work in IE -->
<Meta http-equiv="expires" content="0">
<!-- Setting the page to expire at 0 means the page is immediately expired. Any vales less then one will
set the page to expire some time in past and not be cached. This may not work with Navigator -->
<Meta http-equiv="Cache-Control" content="no-cache">
<!-- This directive indicates cached information should not be used and instead requests should be forwarded
to the origin server. This directive has the same semantics as the PRAGMA:NO-CACHE -->
</Head>
I hope it can prevent user from going back to the previous page by hitting the Back button on the browser, but it doesn't, what's the right way to do it ?
Frank
I think I'm half way now, but something is missing. I have the following filter :
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class ResponseHeaderFilter implements Filter
FilterConfig fc;
public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException,ServletException
HttpServletResponse response=(HttpServletResponse)res;
for (Enumeration e=fc.getInitParameterNames();e.hasMoreElements();) // Set the provided HTTP response parameters
String headerName=(String)e.nextElement();
response.addHeader(headerName,fc.getInitParameter(headerName));
chain.doFilter(req,response); // Pass the request/response on
public void init(FilterConfig filterConfig)
this.fc=filterConfig;
public void destroy()
this.fc=null;
}And in my web.xml, I have something like this :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
</servlet>
<servlet-mapping>
</servlet-mapping>
<session-config>
</session-config>
<welcome-file-list>
</welcome-file-list>
<resource-ref>
</resource-ref>
<filter>
<filter-name>ResponseHeaderFilter</filter-name>
<filter-class>ResponseHeaderFilter</filter-class>
<init-param>
<param-name>Cache-Control</param-name>
<param-value>private,no-cache,no-store</param-value>
</init-param>
<init-param>
<param-name>Pragma</param-name>
<param-value>no-cache</param-value>
</init-param>
<init-param>
<param-name>expires</param-name>
<param-value>0</param-value>
</init-param>
</filter>
</web-app>I rebuilt the project and ran it, and yet, I can still hit the "Back" button and get to previous page, what am I missing ? Is what I've done in the web.xml file enough to set it up, or do I need to call ResponseHeaderFilter somewhere in my servlet in order to use it ?
Frank
Similar Messages
-
Why can't I get to the previous page by hitting the back button just once?
Hi there.My problem is that when I try to go back to the previous page(s) and hit the back button nothing happens.I have to hit it twice or triple to force action.This is happening after the latest update of mozilla.I know that in previous mozilla versions you had to double-click to go back to previous pages, but in the latest versions you could go back by just one click(double-clicking remained as a choice for the romantic...).Is it a matter of set up?Please answer cause it's really annoying...
See http://kb.mozillazine.org/Locked_or_damaged_places.sqlite
Also, Can you try to start Firefox in Safe Mode to see if Firefox works properly with no error? You can start Firefox in Safe Mode below:
*'''Windows/Mac''': Go to Help > Restart with add-ons disabled
*'''Linux''': Run ''firefox -safe-mode'' in the Terminal/Konsole
If Firefox opens up fine with no problems, it's probably one of your extensions that's causing the issue. You can re-enable your add-ons one by one until you find the one that causes the issue upon being re-enabled. -
I've upgraded to LION. It looks like LION eliminates the finger gestures within internet browsing that used to yield navigating to the previous page or navigating to the next page. I think it was a 3 finger swipe to the left and a 3 finger swipe to the right. It looks like this has been eliminated. I've gone into the system preferences and went through all the new settings for the track pad finger gestures. I've not found a combination that allows me to swipe on the track pad to do the page forward / page back function.
How to I get this back? I was my favorite one and now I can't get there!For going back to the previous page try a 2-finger gesture. Two fingers in the other direction will take you back.
cornelius -
My pages in Foxfore are overlaying one another which is normal but you cannot get back to the previous page. An example is if I have a page opened in a program and open something totally different it replaces the first page and I cannot reduce the size to see the first page I was viewing nor go back to it. I did open a page with audio and opened another application in foxfire and the replacing went on as usual but the audio continued to play so the page is stinn there. Also the tool bar page showing icon is replaced with the newly opened page not an additional page opened being shown as a tab. It's like the newest page or site I open in Foxfire replaces the one that is currently opened.
== This happened ==
Every time Firefox opened
== I first had sites opening with FoxfireThis might be caused by a recent Flash 11.3 update.
See:
*https://support.mozilla.org/kb/flash-113-doesnt-load-video-firefox
*https://support.mozilla.org/kb/keep-flash-up-to-date-and-troubleshoot-problems
Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Websites+look+wrong -
Serious issue.....
Might be a Safari extension issue...
From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall. -
Back (or show previous page) button and Ebay....
Hello all. I am having a problem with ebay and the back button on Safari. It started with version 3, and it continues to version 4. When I am looking at an item, if I click the back button, the page just reloads. I have to double click the back button to go to the previous page. I have just noticed this on the ebay site and no others. Any ideas? Thanks for the input.
having the same problem at www.dealnews.com
not a problem with previous 3.32 version, but now i can't get back to the previous page without pressing the back button twice quickly.
if you press it once, it just reloads the same page.
i've reset safari, but nothing fixes it.
anyone else have an idea?
thanks! -
when i am surfing on the net with firefox browser i cannot anymore return to a previous page that i visit using the left arrow!
Sometimes when you click the back button the previous page redirects you forward again. Right-click the back button to use the history list to skip the previous page and go further back in history. If there is no history list, hmmm, it must be something else.
-
how do i cancel my subscription when i go to the page on adobe it just goes back to the previous page. is there an email address i can contact the customer support?
I don’t know the email address, but this page might help:
Cancel your membership or subscription | Acrobat.com online services -
It's so annoying!! I have created a new Apple ID but after I click verify it just goes back to the previous page!!! It''s really frustrating I have tried for more than 4H, and the problem is not about the apple ID. I can download apps with the apple ID, which means IMessage is the problem! I restarted my iPad, I logged in and out of the apple ID in the store, AND YET IT STILL WON'T WORK, PLEASE HELP!
Hi Vmanfromusa!
It sounds like you are having an issue with activating your iMessage app on your iPad. An article outlining some troubleshooting steps for this issue can be found here:
iOS: Troubleshooting FaceTime and iMessage activation
http://support.apple.com/kb/ts4268
Thanks for using the Apple Support Communities. Have a good one!
-Braden -
My IPAD 3 [5.1.1 (9B206)] has a problem.
- It restarts every three (3) minutes: it goes out then comes back but lost the previous page (auto lock is set to 15 minutes)
- It can no longer connect to the mobile network orange except Wireless (WIFI)Not normal. Take it to an Apple Store for evaluation.
Make a Genius Bar Reservation
http://www.apple.com/retail/geniusbar/
Cheers, Tom -
When I am on Safari, the page randomly goes back to the previous page I was on. This is really frustrating when I am writing something online because it does not save my work. Fix for this?
(A) Reset iPad
Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
Note: Data will not be affected.
(B) Reset all settings
Settings>General>Reset>Reset all settings
Note: Data will not be affected but settings will be reset. -
When I open Safari, it goes to the home page but there is no tool bar at the top of the window, and the home page is in the middle of a white window that is full screen. I cannot do anything with Safari because there is no toolbar. how do I get the tool bar back.
Thanks for any help.
PhillipSounds like you are in Full screen mode. Run your cursor to the top of the page and click on the blue arrows on the right hand side.
-
In snow leopard, 2 fingers to the left on the mouse went back to the previous page. In Lion, it opens the dashboard. How can i make firefox go back to previous page with two fingers left on the mouse??
Hi,
I don't know of a preference, but have you used ⌘-T in iCal?
Best wishes
John M -
Often the back button will not work. I can find no "close tab" under the menus, which I think used to be there, and which is used with Internet Explorer to go to the previous page. How can I go back to the previous page with Firefox when the back button will not work?
No you can't. Apple don't support downgrading of iOS.
-
I recently purchased a brand new Airport Time Capsule 2TB. I already am using the previous generation time capsule to back up all my computers data. May I ask how can I complement the usage with my new time capsule?
By default your new Time Capsule will broadcast an unsecured wireless network with a network name of something like: Apple Network NNNNNN
Most likely your iMacs will be connected to the wireless network created by the Virgin Media router. However, both should see the Apple Network under the AirPort icon's drop-down menu as another wireless network that they can connect to. Is this not the case?
Maybe you are looking for
-
Could someone please tell me how long Oracle will be supporting Oracle vs 8i?
-
XML data not displayed with XSL
I have just started learning XML so bear with me. I have a xml document that I created and want to use a stylesheet to display it in html but it doesn't seem to be working. Here is the xml file: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet
-
Downloaded IOS8 and now my Facebook app will not open, also safari functions erratic.
Downloaded IOS8 and now my Facebook app will not open,also safari functions erratic.
-
Does anyone have sample code to generate a random string of 12 characters? Urgently needed. Thanks very much for any replies.
-
Dragdrop within ALV on certain column
Hi, In a report I enabled drag & drop. It works fine. Whatever row/column I drag the event is picked up. The handle is given in the layout structure of the ALV (GS_LAYALV-S_DRAGDROP-ROW_DDID = HANDLE_ALV). I want to limit drag & drop to a specific co