I have a form, in which I want to retrieve the values entered in the fields, I have the following code in the controller
@RequestMapping(value= "/views/consulta", method = RequestMethod.GET)
public String redireccionaConsultaPage(Locale locale, Model model) {
model.addAttribute(Constantes.CONSULTA_FORM, new Consulta());
return Constantes.CONSULTA_VISTA;
}
I made a Query class, which contains the attributes that I retrieve from the form, including name and payment, and payment. and pass it as a parameter to the model.addAttribute (), I also pass a string called "query" which is the name I put in the modelAttribute attribute of my form, only that I put it in a constant, only I do not understand even what is that for? Now, if I want to paint in console that data that I recover from the form, how do I do it? Would I have to do another method? is that I want to see that data in the console and also since I have those attributes, I want to pass them as a parameter to a method to make a query and filter with that data I just start with spring and I do not know very well How do I recover that data?
this is my form
<form: form id="consulta" modelAttribute="consulta">
<tr>
<td><label>CENTRO PAGO</label></td>
<td><form: input type="text" id="pago" path="nombrePago"/></td>
</tr>
<tr>
<td><label>DIRECC PAGO</label></td>
<td><form: input type="text" id="direccpago" path="direccPago"/></td>
</tr>
</form>