-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Originally posted by sattithey botla:
Hi,
i want to know is there any other way to handle the browser back button. If the user click on browser back button i want to send him to error page.
How can i do that.
SCJP, SCWCD.
|Asking Good Questions|
Originally posted by sattithey botla:
Hi,
i want to know is there any other way to handle the browser back button. If the user click on browser back button i want to send him to error page.
How can i do that.
Originally posted by seetharaman venkatasamy:
you need to prevent browser cache and maintain session properly on every page......
Originally posted by Adeel Ansari:
"page expired" means browser is prevented from caching the page, I suppose. In fact it was a POST request.
[ October 22, 2008: Message edited by: Adeel Ansari ]
Originally posted by seetharaman venkatasamy:
Hi Adeel Ansari,
you are right but,
i am suggesting to the sattithey botla's question . clearly i quoted .
Originally posted by Adeel Ansari:
Even then its nothing to do with both, the browser cache and session, I believe.
Originally posted by seetharaman venkatasamy:
if you prevent browser cache and click the browser back button... the controll will go on server side .
you believe me ?
Originally posted by Adeel Ansari:
And how then you distinguish, on the server-side, between the normal request and the request resulted from back button?
Originally posted by seetharaman venkatasamy:
After pasting the above code in the jsps
Originally posted by seetharaman venkatasamy:
(request is request ..There is nothing called the normal request and request from back button)
Originally posted by Adeel Ansari:
You can do it using JavaScript. Otherwise, there is no way server can recognize whether the request is the result of a back button or the user posted the same URL again, deliberately.
Originally posted by Bear Bibeault:
why not just do this in a filter?
Originally posted by seetharaman venkatasamy:
Good suggestion. i know about filter,but i do not know how to use this concept in filter...
any idea or good url(link) to learn ?
Originally posted by seetharaman venkatasamy:
i do not know how to use this concept in filter...
any idea or good url(link) to learn ?
SCJP, SCWCD.
|Asking Good Questions|
SCJP, SCWCD.
|Asking Good Questions|
Originally posted by seetharaman venkatasamy:
so java script is only way? no. my point is using session also we can send him to the error page when he click on the browser back button
Originally posted by Adeel Ansari:
And how then you exactly distinguish, on the server-side, between the normal request and the request resulted from back button?
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
You could if you use a token. The first time that token is submitted is the initial request. Subsequent times are from the back button.
Originally posted by Adeel Ansari:
Hence, its better to do this stuff in JavaScript.
Originally posted by seetharaman venkatasamy:
note: i expriment this scenario.
Originally posted by seetharaman venkatasamy:
if yes, how you will do in javascript?
Originally posted by Adeel Ansari:
Ok, same question again. How did you manage to distinguish between a deliberate request from the user and a request made by pressing back button?
Originally posted by seetharaman venkatasamy:
why this?There is no need to know this.. once again and last i said you need to maintain session(ofcourse you need to do business logic) properly
Originally posted by Sripad Kumar:
Hi,
I am developing few portal pages using JSP. I am facing some problems when HTML form is submitted and subsequently hit browser back button. I'm using POST to send the data to the server(I cannot use GET method instead of POST according to our requirement). I need to retain all the values entered in first page for subsequent search. I am handling through by storing all the values in Request object. But when I hit back button, I am getting "page expired" error.
Please provide me some work-around for this problem.
Thanks in advance.
Sripad.
Thanks & Regards
Ayyappan
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|