Solved

Stopping parameter resubmit on refresh

Posted on 2004-04-02
3
1,655 Views
Last Modified: 2008-03-10
Hi,

Is there a way to stop parameters being resubmitted when a jsp page is refreshed. The parameters are being sent by GET but out of interest is there a way that could do it for POST or even both? Thanks.

-Sam
0
Comment
Question by:samblake
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10742074
well there is no sure shot way of doing it.... but we usually employ a switch method... i.e. we have a hidden field in every form of the system... it starts with a zero....... and when first request hits the server it goes in the session as 0.... now when the request is finished we bump it by one.... so next form gets it as 1.....
so next time around when the request comes back to us... we check if the session value is 1 less then the recieved one...
If not its considered as a resubmit/refresh....

try that if that works for you...
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 50 total points
ID: 10743840
what Kuldeep suggested is refered as using token, Struts has build in token support.

another approach would be after processed the request. do response.sendRedirect() to the said jsp page (maybe itself), EE is taking this approach for this post thread.

I'm not saying which one is better. in fact token always work. sendRedirect() is easier but restricted by the why your jsp page is coded.
0
 
LVL 1

Author Comment

by:samblake
ID: 10749047
Yep, just put sendRedirect(request.getRequestURI()) and it worked great. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question