Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Delete database record from JSP with JQuery  RSS feed

 
Chris Palombo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I hope I can get some help, I'm stuck on this problem and I'm starting to go mad:



this is my servlet post code,



and this is my JSP.

The problem is easy, when I click on the grid for deleting the record two things happen, or the record is deleted only on JSP but not in my Database or Nothing happens even on my JSP, it is because I don't know how to get values from my jsp and send them to replace the ?,? in my delete query I tried even to give a name to the <tr> which contains Name and Last name but obviously i guess it works only for input type ex. Textbox.

Thank you for all your asnwer!
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you verified that a request is going out from the browser to the server?

Does the request invoke your servlet? Does your web.xml have the proper servlet mapping to match the url pattern of the request?

The database code in your servlet looks ok at first glance.. check the above..
 
Chris Palombo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your asnwer, yes the connection with servlet and database works fine, the problem is that the servlet can't retrieve values from jsp I don't know how to achieve it.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I can suggest is that the request parameters needs to be in an input elemement like this..

<input type="text" name="nome" value="some value">

Here you might stylize it to suit the look and feel of your page..

Not sure how the jquery code works here.. and there may be a form tag needed as well..
 
Chris Palombo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gamini Sirisena wrote:What I can suggest is that the request parameters needs to be in an input elemement like this..

<input type="text" name="nome" value="some value">

Here you might stylize it to suit the look and feel of your page..

Not sure how the jquery code works here.. and there may be a form tag needed as well..


I know but the records of my database are displayed inside a html table and this table for each row has got a delete icon button that with jquery and ajax call the post method, so since I'm using a html grid view I cannot use input, I want it to know which parameter delete through the table.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!