How to redirect to a different page when a browser's Back button is clicked

In my application a user logs-in and searches on the form provided. Now
If a I click on browser's Back Button I see a message saying Page Has Expired, now at this point if I click on the browsers refresh button it shows me the page again.I want if browser back button is clicked and then Refresh button is clicked I don't want to show the same page rather redirect to a different page and invalidate the session. Is there a way clicking on browser back button I redirect to a different page.I have the following code on top of each jsp pages:
response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibilityAny help is appreciated. Thanks

There's no way to know when the back button is clicked, so I don't see how you can do anything about it. Since that message comes from a page which was created by a POST form submission, you can put some unique value in a hidden field that let's the server side record and if it gets it again (from the reload) then it can ignore the form data and redirect.

Similar Messages

  • Firefox will not load pages when I use my back button

    It is just doing this on the one site

    Does this happen when you are both logged in and out of the website? I have tried accessing the website myself and I am able to access the site and use the back button on this site without logging into the site. If this only happens when you log into the site most likely it has to do with the login session that causing this problem.

  • How to redirect users to different pages after logging in?

    Please HELP this is doing my head in.
    I have created a login for a site using dreamweavers login tools, but I need to direct users to their individual pages, as Dreamweaver shows only one.
    I here you can store urls in you data base then call on them depending on the user is this correct ?
    Or is there another way ?
    Could someone show me what I need to do ?
    Any help would be appreciated
    Dazza

    Hi
    It would become a long reply if I showed you, and I would require your database structure. So this is a simple 'things to do / steps to take' list.
    (the access level and user id, (not the same as database table id) are used interchangeable here)
    The first item is to ensure you have your database set-up to allow the items to be recovered from it dependant upon the users id/access level. This could be done via a simple access level being set, the access level would be set in the user table and the page content from the database would have a matching column in the table for content.
    The DW authentication server behaviour will set the access level in the same session variable at the same time as the logged-in session is set, (see the DW documentation on user authentication for how to use this feature).
    It would then be a simple matter of retrieving the information for the page using the DW recordset query server behaviour, which can also automatically set the access level in the query code to ensure that the items to be retrieved matches the access level.
    The biggest problem most people who try to set-up a restricted access section of a site, is not the server behaviour to restrict access to content, but the cms section of the site to create the content as required. For this is may be worth while reading - http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html, although your database code would be slightly different as you would require the access level/user id be used to 'filter' the results returned and the items for the user to view, (links to content) also must be access level/user id dependant, (tip, use conditional region code for this).
    PZ

  • How to redirect to an error page when database is down

    We have build an struts/jsp-application with JDeveloper 10g and ADF. If the connection to the database fails, we get a plain page with header "500 Internal Server Error" and the exception and a stack trace. Of course we want to catch this exception and redirect the user to an error page with all of the standard design elements of our site and with a textual description of the error of our one choice.
    Our attempts to solve this includes adding error-page tags with error-code and exception-type:
    <error-page>
    <exception-type>javax.servlet.jsp.JspTagException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.JboException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.DMLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.sql.SQLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <error-code>500</error-code>
    <location>error.jsp</location>
    </error-page>
    Are there other ways to do this, or are there things we have forgotten to do, that has to be done for this solution to work.
    We have also tried try and catch in a variety of the lifecycle methods in the DataAction subclass for the page, but none of these are ever called. It seems the error happens before the first lifecyle method starts. We can't figure out where to catch this exception.
    In other cases the web.xml mechanism seems to work.

    Try the Global Exception Mechanism within Struts...

  • How do I keep my place on a page when I hit the back button?

    In other words, say I'm scrolling down a list of links from 1-30. I hit link #8, read it, and then want to go back and continue scrolling down the list. When I go back, though, Firefox has lost my place and sends me to the top of the list. I think this started happening with the latest version of FF. Anyone have a fix? Thanks!

    Interesting. You're right. It doesn't happen when I click away from this site and then return. Maybe I'm barking up the wrong tree. Maybe it's the specific website I was thinking of and not Firefox. Unfortunately, I have to use that site all the time for work. I'll try contacting their webmaster. Thanks for your help.

  • How to redirect user from login page to "Set Challenge question" page

    How to redirect user from login page to "Set Challenge question" page (NOT custom page) after 3 un successful password attempts?
    Meaning when user types wrong password 3 times they will be redirected to set Challenge question page. If user answers the challenge question then password reset page should be appeared other wise (after remaining 3 un successeful challenge question answers) account should be locked out.
    thanks for your help.

    hi sandeep
    Thanks for your answer. Let me ellaborate more on the requirement here.
    - Password Policy and Lost Password management are set up in the identity system
    - Configure login tries allowed= 5. Verify accout is lock out after 5 unsucessful login.
    This is what need to achieve.
    1) If a user attempts to login 3(not 5) times using an incorrect login credential he/she should be redirected to set challenge question (security question) page.
    2) Then if the user attempts (remaining) 2 times incorrect challenge answer then his/her account should be locked out.
    3) If he/she answers the challenge answer correctly then he/she should be redirected to password reset page.
    Is this possible?

  • Problem with history when ther is page redirection after 'go back' button is clicked.

    Recently I was developing some application which requires request redirection from server when the browser's 'go back' button is clicked. At that time while I was testing implemented behaviour i noticed that when i go one page back forward button is disabled and when I want to go back again I am returned one the same page over and over again. It seems that there is a problem with history and how firefox handles a page redirection.
    In other browsers everything goes as it should and there isn't any such problem with history.
    I hope that this problem will be solved in the next version.

    Hi,
    I found this Terminal command here on the discussion board posted bu Sinzu.
    defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnable d -bool YES
    Dimaxum
    Sorry, everyting is BOLD tekst.

  • How to avoid printing a blank page when there is 'no data' in the report.

    how to avoid printing a blank page when there is 'no data' in the report.

    try like this
    if@section:IND=1
    this template
    end ifsectionbreak
    if@section:IND=2
    this template
    end if

  • How can I display the same page when I'll press

    i have a jsp page. It contains user name & password.
    and a link like SIGNOUT COMPLETELY. when i press the back button it should show only this page.
    You have noticed one thing that when u sign out from YHAOO MAIL then a page is displayed
    USERNAME : [email protected]
    PASSWORD :XXXXXXXXXX
    SIGNOUT COMPLETELY
    when this page is dispalyed and u press the back button of the browser
    it displays the same page. How it happens?

    Kindly neglect the previous post.....
    Okay check something like this
    1).maintain either a HttpSessionListener or a session flag try to checkout whether the user is active or else close the PrintWriter.
    2).Prevent caching of the webpage by using customary meta tag or by response,setHeader("Cache-Control","no-cache");
    way...
    Guess tht shud work.....

  • How to redirect to same oaf page on "Submit"

    Hi,
    I had a requirement that i need to call a procedure when "SUBMIT" button is clicked to validate the data on the review page. For this i need to extend the seeded controller (NavigationCO on "oracle.apps.per.selfservice.review.webui"). In the seeded controller on submit button click it's redirecting to the final confirmation page. But now i need to validate the data on Submit button click and throw an exception if the data is invalid. If the data is valid i need the same seeded controller code to be executed.
    For testing purpose i tried to the following code to throw an exception when submit button is clicked. I tried using the following code but its displaying an error on click submit.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    if (pageContext.getParameter("HrSubmit") != null) {
    super.processFormRequest(pageContext, webBean);
    pageContext.forwardImmediatelyToCurrentPage(null,true, "Y");
    throw new OAException("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    }else{
    super.processFormRequest(pageContext, webBean);
    Please help me out its very urgent.

    I tried to use the below code and tried to redirect it to the same page but its throwing an error.
    ERROR: You cannot complete this task because you accessed this page using the browser's navigation buttons (the browser Back button, for example).
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    package xxcal.oracle.apps.per.selfservice.review.webui;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.per.selfservice.review.webui.NavigationCO;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import com.sun.java.util.collections.HashMap;
    public class xxcalNavigationCO extends NavigationCO {
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    if (pageContext.getParameter("HrSubmit") != null)
    pageContext.setForwardURLToCurrentPage(null,
    false,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAException.INFORMATION);
    /*pageContext.setForwardURLToCurrentPage("OA.jsp?page=/oracle/apps/per/selfservice/review/webui/ReviewPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // Show breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES); */
    super.processRequest(pageContext, webBean);
    Can anyone help me with this issue.

  • How to get login page when user clicks on browser's back button

    Hi,
    I am using struts framework.
    I have set property nochache=true in response header of all pages.
    So, browser does not caches my pages.
    Now,when I am clicking on browser's back button, I am getting following message..generated by browser.
    Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
    To resubmit your information and view this Web page, click the Refresh button.
    Instead of that I want to show user a login page, when it clicks on back button.
    Can anyone help me?

    Hi,
    I agree with your suggestion.But my query is,
    If you have seen many credit card or banking websites,generally when user clicks on browser's back button,its redirectly user to login page of it for security reasons.
    I want to implement that kind of functionality.So need help on that point

  • In Pages, when I hit the return button, the first letter on the new line is not capitalises. How do I get it to capitalise automatically?

    In Pages, when I hit the return button, the first letter on the new line is not capitalises. How do I get it to capitalise automatically?

    Right click the Back button and choose the page you want to go to from the list.
    '''N.B.''' I noticed that your Flash installation is out of date which exposes your system to attack. See: http://www.adobe.com/support/security/bulletins/apsb11-18.html<br><br>
    Update via http://get.adobe.com/flashplayer/

  • How to go to previous page in task flow using 'BACK' button in the browser?

    Hi...
    I have created system using ADF application that can detect 'BACK' button in the browser(e.g. firefox and google chrome).Everytime i click the 'BACK' button in the browser,it will prompt out message that ask user whether want to 'stay in the current page' or 'leave the page'. Once i click 'leave the page' it will take me to the login page.
    Is there any possibility for go back to previous page in task flow when user click on browser's back button? By the way, the task flow is in the page fragment.
    can anyone tell me how to do it?Need this step urgently..
    Thanks in advance.
    Edited by: 942376 on Jun 22, 2012 11:03 PM
    Edited by: 942376 on Jun 22, 2012 11:07 PM

    Can you send that code to have a look ? Share it on some site

  • To Dispaly stale data page when browser back button is clicked.

    Hi All,
    How can we display Stale Data Page when the browsers back button is clicked.
    thanks

    You have already raised a thread for this..
    To display Stale Data Page when browsers back button clicked.
    - Senthil

  • I have a currently updated Mac that's fast as lightning. I use eBay A LOT. In the newest version when I hit the back button it takes me to the original "new tab" page. Please don't make me use Chrome or Safari, I love you guys

    Hello,
    I have a Mac that's fast as lightning running on the latest version of OS X. I use eBay A LOT. In the newest version of Firefox that I just downloaded when I hit the back button it takes me to the original "new tab" page. Please don't make me use Chrome or Safari, I love you guys

    Thank you for your kind words on the Tablet, as this is the only product mentioned that is supported on this forum, The forums here are for Home Electronics and Computers, and do not reach the Sony smart phone community.
    The Sony smart phone Support Forum is the place for Sony (formerly Sony Ericsson) users from around the world to get help and help others:
    your very in depth suggestions and comments would best be heard at the following forum that is dedicated exclusively to the Sony smart phone community.
    http://talk.sonyericsson.com/community/support

Maybe you are looking for