Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

    Default warning that page has expired and i need to refresh the page again

    We have built an dynamic web application. In the application if we use the browser back button or forward button, it shows a warning that page has expired and i need to refresh the page again. Is there any way to avoid this. This problems come in IE6.

    Like this
    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.

    Is there any way to do this.

    Help needed

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Talking form submit

    Quote Originally Posted by 82rathi.angara View Post
    (...)Is there any way to do this.
    Write your own forward and back buttons, just label them forward / back / update or whatever makes sense. Do the logic in the forms handling code. Too many browsers, and each have their own agenda.

    It is consequential enought to do forms handling, I would not rely on browser for forward and back control.

    Quote Originally Posted by 82rathi.angara View Post
    Help needed
    I get over half of my code for free writing solutions to other people's questions. I wrote a major core component Thur, Fri, Sat that I had made sluggish progress on. I call it LittleBeanTestSuite and WombatKeyControl

    ( humor folks, humor )

    Do you think I need help? If you do, you have been talking to too many interviewers and need to focus on the code base.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Quote Originally Posted by 82rathi.angara View Post
    We have built an dynamic web application. In the application if we use the browser back button or forward button, it shows a warning that page has expired and i need to refresh the page again. Is there any way to avoid this.
    This is not a problem, its a feature.

    Why do you consider it a problem, this is how the Web works.

    Building applications that do what you want, and still let the user use the browser's back and forward buttons has been a challenge from the beginning. Its a feature. Its why we developers get paid big bucks.

  4. #4
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

    Default This is no-cache problem?

    Quote Originally Posted by fishtoprecords View Post
    This is not a problem, its a feature.

    Why do you consider it a problem, this is how the Web works.

    Building applications that do what you want, and still let the user use the browser's back and forward buttons has been a challenge from the beginning. Its a feature. Its why we developers get paid big bucks.


    ya ...you are saying right that this is not problem . But we need Solution when i return to shop cart page to product page and again go to shop cart page ....this warning page come........

    Somebody told me that this is no-cache problem . I put some code in our java file.
    Like this:
    public class AntiCacheFilter implements Filter {
    public void destroy() {}

    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    if (response instanceof HttpServletResponse) {
    ((HttpServletResponse) response).setHeader("Cache-Control",
    "no-cache, must-revalidate");
    ((HttpServletResponse) response).setHeader("Pragma", "No-cache");
    ((HttpServletResponse) response).setDateHeader("Expires", 1L);
    }

    chain.doFilter(request, response);
    }

    public void init(FilterConfig config) throws ServletException {}
    }




    I added this code
    ((HttpServletResponse) response).setHeader("Pragma", "No-cache");
    ((HttpServletResponse) response).setDateHeader("Expires", 1L);
    in file .But No solution.....

  5. #5
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Quote Originally Posted by 82rathi.angara View Post
    ya ...you are saying right that this is not problem . But we need Solution .
    The phrase "its not a problem, its a feature" is an idiom. You have a problem, but the system is working as designed. Its a feature.

    If your problem space requires different actions, you have to implement it all, because the browsers are working properly per the spec.

  6. #6
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Quote Originally Posted by 82rathi.angara View Post
    Somebody told me that this is no-cache problem .
    They didn't steer your correctly. Its a feature of POST.

    no-cache is not going to help. Even if you had a no-cache problem, the directives are hints not rules. The browser may chose to pay attention, or may ignore it.

Similar Threads

  1. Go back to previous page using session in JSP page
    By gopikarikati009 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-23-2011, 11:30 AM
  2. Refresh the page
    By udhayageetha in forum AWT / Swing
    Replies: 2
    Last Post: 07-01-2008, 10:03 AM
  3. How to Refresh the same page by JSP
    By AbuAziz in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 12-10-2007, 05:06 AM
  4. How to run jsp page
    By nikisonproblem in forum New To Java
    Replies: 1
    Last Post: 07-09-2007, 04:16 PM
  5. warning: page has expired
    By Peter in forum Web Frameworks
    Replies: 2
    Last Post: 07-04-2007, 08:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •