I have an HTML table with rows fetched from a database displayed in that table. I want the user to be able to delete a row by clicking on a delete hyperlink besides each row.

How do I invoke a JSP function on the page, when the user clicks on each of those delete hyperlinks, so that I can delete that row's entry from the database? What exactly should the tag have to call the JSP function?

Note that I need to call a JSP function, not a JavaScript function.

Thank you.

[Also posted at: http://stackoverflow.com/questions/3078701/jsp-how-do-i-call-a-java-function-by-clicking-a-hyperlink]

1 answer


The short answer is that you don't. The long answer is that you can make an AJAX request to a JSP web service that invokes the function in response.

Answered over 6 years ago by Nathan Duran