no console exibe o erro
Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]
na tela aparece
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sun Nov 06 09:44:19 BRST 2022
There was an unexpected error (type=Method Not Allowed, status=405).
@PostMapping("novo")
public String novo(@Valid RequisicaoNovoPedido requisicao, BindingResult result) {
if(result.hasErrors()) {
return "pedido/formulario";
}
Pedido pedido = requisicao.toPedido();
pedidoRepository.save(pedido);
return "forward:/home";
}
aqui o codigo completo: https://github.com/araujowp/mudi
se voltar para redirect funciona