Link to home
Start Free TrialLog in
Avatar of srnambiar
srnambiar

asked on

Reloading JSP on back button click

Hi,

I am using JSP/javascript in my application.
When a user navigates from one page to another and clicks on the back button I want to reload the previous page via a server call instead of loading it from browser cache.
I am currently using POST method for form submission.

Any idea how I can acheive this?
SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srnambiar
srnambiar

ASKER

If I set the no-cache headers I get a warning message saying that the page has expired.
I do not want this message to appear. Instead I want the previous page to reload.
No Choice, if you don't want to set cache header, you may need to POST to your previous page from your cancel button.
or a javascript like: onclick="window.location.href = 'mypreviouspage.jsp'; " at cancel button maybe be useful too... ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, sigmacon is right. The Page Expired is caused by using POST. If you don't have sensitive info and not too much of it, use GET.

By the way, I read somewhere that the no-cache headers will only work in IE if the document is less than 64kb? Must be a bug in IE..
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial