Sang Shin Tutorial On JSP Session Tracking
843840Aug 19 2008 — edited Aug 19 2008Hello all, I am following the tutorial section by sang shin :-
http://www.javapassion.com/handsonlabs/sessiontracking/index.html#2.1
Whenever I click on "add" button, the cart item will be added into the cart.
However, I realize that, when I click on the browser refresh button, the cart item will be added too. This is not what I wish. I want new item to be added, with only using "add" button.
Says, if I select "Love life" item and click "add" button, the 1st "Love life" item will be added into cart, the browser URL field is updated with :-
http://localhost:14345/jsp-examples/sessions/carts.jsp?item=Love+life&submit=add
Whenever I click on the browser refresh button, the above URL will be submitted to server, causing 2nd item to be added.
Is there any workaround to avoid this?
Thanks!