-1
need to pass the information of a component that is on the jsp page to a controller that is in java.
From what I understand the best way is via AJAX.
Municipal component
<label for="municipio"><font style="color: red">*</font> Municípios</label>
<select class="chosen-select form-control" id="municipio" name="municipio"
data-placeholder="Selecione um município">
<option value="-1"></option>
<c:forEach var="entidade" items="${listaEntidades}">
<option value="${entidade.id}">${entidade.municpio.codigoNome}</option>
</c:forEach>
</select>
The information is showing correctly on the screen.
I need this id="municipality" name="municipality" information to do actions in the Controller class.
Thanks Carlos But I went into his example and he doesn’t show "Alert("city: "+city);", after choosing a city. What can be ?
– Guilherme
ready. I edited it for you to visualize
– adventistaam
worked. But what should I put here? Function(data){ /your code/ } For example, how to call a spring Controlle ?
– Guilherme
the return, recommend the json, there would be more or less
if(data.retorno == 1) alert('Feito com sucesso!');
– adventistaam