Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Stopping URL query string being used on refresh

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
scarykitten123
Asked:
scarykitten123
2 Solutions
 
bobbit31Commented:
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
 
kennethxuCommented:
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
 
girionisCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now