Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

record gets inserted twice

 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a assignrights.jsp page from where i assign the rights to the student.
in that page i add privilege, module and submodule and userTypeid on button click into a html table using javascript and when i click on save it gets saved into the database through the assignrightsAction and bean.
but i get problem when i try to modify the record on modify i select the userTypeid and generate the html table containing all the rights of the student in the database.
where i can delete an individual record or entire by using a check box.
when he selects the check box using javascript i m deleting the record from the html table and when i save at that time i check the rowcount of the table getting saved and the actual rowcount when the table was created and then according before saving i delete all the records from the table based on userTypeId and then insert all the records. and display the message "record deleted successfully" on the same assignrights.jsp but when it displays the message it again inserts the same records in to the database. if i add 1 record it will insert the same record twice.
please help??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic