Created
December 30, 2016 19:08
-
-
Save netodevel/6d09a235e0d3894501e083a348543eba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PostMapping("/salarios") | |
public String save(@Valid @ModelAttribute("salarioMinimo") SalarioMinimo salarioMinimo, BindingResult bindingResult, RedirectAttributes redirectAttributes) { | |
try { | |
salarioMinimoService.save(salarioMinimo); | |
redirectAttributes.addFlashAttribute("sucesso", "Salário salvo com sucesso."); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
redirectAttributes.addFlashAttribute("error", "Problema ao salvar salário."); | |
} | |
return "redirect:/salarios/novo"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment