File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes record gets inserted twice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "record gets inserted twice" Watch "record gets inserted twice" New topic

record gets inserted twice

Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

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??

[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
I agree. Here's the link:
subject: record gets inserted twice
It's not a secret anymore!