?
Solved

Stopping URL query string being used on refresh

Posted on 2003-03-21
4
Medium Priority
?
230 Views
Last Modified: 2010-05-18
i have created an online shop system and the 'shopping basket' part is passed an item to add to it. e.g. basket.jsp?additem="lv01"

however when the refresh button is pushed the item is added again which i am trying to prevent.

any suggestions?

Thanks
Mark
0
Comment
Question by:scarykitten123
[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
4 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 152 total points
ID: 8181284
in basket.jsp can't you just redirect to another page after you add the item? even if the page is simply basket.jsp without the querystring?
0
 
LVL 14

Assisted Solution

by:kennethxu
kennethxu earned 148 total points
ID: 8181318
that's a common problem. after your added a new item. use
if(..) { //add new item
  // add it to basket bean in session scope
  response.sendRedirect( "basket.jsp" );
  return;
}
0
 
LVL 35

Expert Comment

by:girionis
ID: 10060225
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Split points between bobbit31 and kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

800 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