hi,
I am using ajax to insert a record in database through Servlet.
Record get inserted properly.
the problem is how to send the exception messages in the ajax method so that appropriate can be displayed to user in case exception occurs?
$.ajax({
type: 'post',
url: 'registdata',
data: $('#registdataform').serialize(),
success: function (data) {
// $("#form")[0].reset();
alert("sucess");
},
error: function(data) {
// check status && error
},
});
how to pass message through servlet in ajax?