Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

i need to print a name ,when ever i refrsh my page i am getting duplicate elements,name appears as amny times i refresh,i am new to jsp please help me,it urgent

i need to print a name on the page ,i am getting it right .when i refresh the page i am getting the name again ,i stored the values in vector and forwarded to other page to print .I am not able to solve the problem even by using sessions to indicate whether the page is displayed or not.please help em it is urgent
0
master_gopi
Asked:
master_gopi
  • 2
1 Solution
 
Nick_72Commented:
the simplest solution is to test wheter or not your vector already has that element stored when you add it:

if (yourVector.contains("the name") == false)
  yourVector.add("the name");
0
 
Nick_72Commented:
or you could clear the vector at the beginning of the page:

yourVector.clear();
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now