"S. Chen" wrote:
>
> Hi all,
>
> I have a jsp page called summary which displays a general info about all the
> records I got from database. Then if the user clicks on any specific
> record, a detail page will display the detail info about that record. On
> the detail page I have a delete button. If the user clicks the delete
> button, the record should be delete from the database and the summary page
> will show up with the latest results.
>
> Would anybody give me any ideas on how to make the delete button work?
I show an example of this type of processing in my book. You can
look at it online at <http://TheJSPBook.com/examples/ch9/index.jsp>.
The Employee Search example includes a page that lists all employees
matching your search criteria (corresponding to your "summary page")
with a form containing a Delete button and a hidden field with the emp
ID for each employee. Clicking Delete results in a request for another
JSP page that deletes the employee identified by the emp ID and then
redirects to a page that refreshes the search result and displays the
updated table.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets