1
bindingエラーhaserrorがアクティブなときにhttpエラーを返すか、メソッドから終了したいのですがどうすればいいですか?Spring MVC bindingresult haserror return
@RequestMapping(value = "/create", method = RequestMethod.POST)
public Node create(@Valid @RequestBody Node node, BindingResult bindingResult) {
LOG.info(String.format("Create new Node: %s", node));
if (!bindingResult.hasErrors()) {
return nodeService.create(node);
}
else{
// How i can exit without return any Node object ?
}
}
エラーが発生したとき、それは新しいノードを作成するdoesntの、どうもありがとうございました、それが助け場合) –
は、感謝の答えを受け入れます。 – mhshimul