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?
Answer Posted / 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 |
Post New Answer View All Answers
What is byte data type?
Why do we use bufferedreader?
Which variables are stored in heap?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
What are streams?
What is implicit object in java?
Why are the methods of the math class static?
What does the “final” keyword mean in front of a variable? A method? A class?
Can you override a final method?
What are the default and parameterized constructors?
Is java still relevant?
Is singleton class thread safe?
What is the difference between keyword and identifier?
Why chararray() is preferred over string to store the password?
How to reverse string in java?