Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Stopping parameter resubmit on refresh

Posted on 2004-04-02
3
Medium Priority
?
1,750 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

722 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