I have one Shopping cart application, i that i have
selected some items, while clicking submit button by
mistake i have clicked twice or trice, that time items are
selected twice or trice. Actually i want only one copy of
items but its selected twice or trice. So how can we avoid
this problem?
Answers were Sorted based on User's Feedback
Answer / veera
If this question in core (jave Collection): if you are
using list,it will take the duplicate values. so pass
through this list into set it will remove the duplicate
values.
if this question in J2EE servlets: use post method, it it
is not idempotent. once you add item to cart, it will give
the acknowledge before changing in server.
| Is This Answer Correct ? | 12 Yes | 2 No |
Answer / balagangadhar
Using token mechanism in struts we can duplicate requests in
web applications.
| Is This Answer Correct ? | 2 Yes | 2 No |
What is variable and constant explain with example?
If a variable is declared as private, where may the variable be accessed?
List methods available in Java Queue interface
What is increment in java?
What is better - 'bit-shift a value' or 'multiply by 2'?
what is mean by method signature?
When is the garbage collection used in Java?
What is the code inside the public void actionPerformed(ActionEvent ae) override method in Applet [ Condition:- you have one TextField and One Button , you have to enter any color name inside the TextField, when you click on Button Your background will change according to your input color name]
how to use crystal reports in java
What is abstract class? Explain
Why Static variable required in java?For ex,class A { static int a; int b; } Why static is required?
What is difference between path and classpath in java?