Well, those are really two separate issues, though if you achieve the
second you would no longer need to worry about the first. What you
probably want, though, is for the user to be taken to the login page
only if they've logged out (or their session has expired), in which case
the first problem still applies.
To redirect to a login page when the user hits back, you need to (a)
disable page caching as discussed in this thread and (b) include a check
in your actions (or using a servlet filter) to see if the session is
valid and do the redirect if not.
To avoid resubmits, there are a few options. The simplest is probably to
use Struts' built-in support for transaction tokens. You include a token
as part of the request when the form is submitted and, in the action
that processes the submit, you check if the token is valid and reject
the form submission if not.
L.
sma3har wrote:
I would like to prevent submitting the page twice as
well as when back button is pressed user should be
taken to login page.
Thanks
--- Laurie Harper <[EMAIL PROTECTED]> wrote:
sma3har wrote:
When i submit the page and hit the back button i
can
submit the page again. The browser is caching the
jsp
page. I have tried adding this code :
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
to my jsp page but did not help.
Any solution to this problem? Experts please
help....
What problem, exactly? How is page caching related
to resubmitting the
page? Those are separate issues.
Do you want to prevent the page from being cached,
so that when you hit
the back button the page is re-rendered with fresh
data? Or do you just
want to prevent the same form being submitted twice?
L.
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]