I have the following javascript
<script type="text/javascript">
function calculaReducao(){
var nd1 = document.getElementById("nrDentes1").value;
var nd2 = document.getElementById("nrDentes2").value;
$.post("calcularReducao?nd1=" + nd1 +"&nd2=" + nd2);
}
</script>
cell in table
<td><input type="button" onclick="calculaReducao();" value="Executar" /></td>
and the controller
@RequestMapping(value = "/calcularReducao", method = RequestMethod.POST)
public ModelAndView calcularReducao(double nd1, double nd2) throws IOException {
ModelAndView mv = new ModelAndView("/calculos.jsp");
double resultado = nd2/nd1;
mv.addObject("reducao", resultado);
return mv;
}
And with all this, the click of the button returns me a 405 error, as if it were trying to get a get.
Message Request method 'GET' not supported
Description The method received in the request-line is known by the origin server but not supported by the target resource.