1

I have a jsp page which contains a form which calls a servlet, after inserting data into the database by a servlet hot to display successs alert to the user on the page?

Thanks in advance for answering.

4

2 に答える 2

1

Either you call the servlet asynchronously with AJAX and have a success callback function (see jQuery example: http://api.jquery.com/category/ajax/ )

Or you do it the old fashioned way with a synchronous Post which loads a success page, or the same page with for example a query parameter that states that you have succeed. This could then be used to activate a script block in your JSP (or whatever template language is your flavour).

于 2012-04-17T08:48:00.730 に答える
0

You can use a javascript alert box. See http://www.w3schools.com/js/js_popup.asp

于 2012-04-18T17:14:58.033 に答える