How to pass data that a servlet gets from a BD to an HTML page? no JSP

-1

This is more a doubt of something that could be feasible to carry out.

What I want to do in itself, is that from a servlet I communicate with mysql to get the results of a table, and I want to pass that data to a table on an html page, I know it can be easy using JSP, but I would like to know if there is any other way to do that.

Thank you.

    
asked by Angel Perez 26.04.2017 в 05:44
source

1 answer

0

yes you could use ajax. This would take you more time but you could do it in JavaScript, which allows you to fill the table with data from the database without having to refresh the page. (Here) [ link you have a link which explains well how to do it in JQuery, the procedure is quite simple: You create a Servlet that accesses the data you want to teach from the database and converts it to Json, you put it in a JsonArray and print it on the screen. Here you have the servlet created. On the other hand you have the page with Jquery, which calls your servlet asynchronously and gets its data. the next thing would be to fill in the table that interests you through DOM.

    
answered by 26.04.2017 в 08:35