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 a protected void?
Why arraylist is used in java?
Which class cannot be a subclass in java?
What does the “static” keyword mean?
What is annotation in java?
If goto and const is reserve words than why it is not work in java?
Explain the importance of throwable class and its methods?
What is method overriding in java ?
Tell me the Importent classes in net package?
What are the advantages of defining packages in java?
Difference between overriding and overloading in java?
What are the two environment variables that must be set in order to run any java programs?
What is ++ a in java?
What is static block?
What is the length of a string?