lundi 21 septembre 2015

Response from Servlet and execute a JS function in jsp

I have a web using Java (JSP and Servlets) and HTML, CSS, JS. I want to test a database connection in onclick event button and if this is right connected show an alert using toastr.js. So, I´m working using MVC pattern with jsp views and servlets like controllers. Currently the button is on jsp file and go to servlet to check the connection but I dont know give this response (boolean value) back to the jsp page to show the toastr.js. Please, somebody could give me an example how execute a .js function in jsp depending of servlet response?.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire