Is there any way to send parameter to servlet and receive a json in the same AJAX function? Example of what I need:
function UpdateGrafico(){
$(function () {
//---------------------
//aqui preciso enviar uma data para o servlet realizar um select
$.ajax({
data: "",
dataType: 'json',
url: './GetValores',
type: 'POST',
success: function(data){
//recebe os dados json e atualiza pagina
});
}
I need this form because the JSP page has a button and when I click it, it will get a date that the user selected, and used this date for a select in the servlet, which will return the data to update a chart on the JSP page.