Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sang Shin Tutorial On JSP Session Tracking

843840Aug 19 2008 — edited Aug 19 2008
Hello 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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2008
Added on Aug 19 2008
1 comment
129 views