I have a project where I must fill a modal window from the database using Ajax, I will explain the project, I have the web services rest in C # and I am consuming it from Java 2EE with servlet and a class called Web Services, but at the moment of doing the Ajax in the Java project, tells me that the url of the method does not find it, this method is SearchPerId (); then, when pressing the button modify the one that appears in the photo with a box and an arrow, the button has the id of the element in the value=""; , then when I press it I should look for ID in the database, in a photo I will leave the error that appears.
$('.keyModal').click(function (){
console.log("Modal esta abierto");
$('#myModal').modal('show');
var idFormulario = $(this).attrib('id'); //Tenemos el id del formulario
$.ajax({
dataType: 'Json',
type: 'POST',
url: 'BuscarMedicamentoPorId/',
data: {id = idFormulario},
success: function (r)
{
console.log("Ejecutó metodo");
//Seteamos los input
$('#txtDescripcionEditar').val(r['DESCRIPCION']);
$('#txtContenidoEditar').val(r['CONTENIDO']);
$('#txtGramajeEditar').val(r['GRAMAJE']);
//Seteamos los valores <select>
$("select#seleccioneTipoEditar").val(r['MED_IDTIPOMEDICAMENTO']).attr('selected', true);
$("select#seleccioneViaEditar").val(r['VIAADMIN_IDVIAADMIN']).attr('selected', true);
}
});
});