回答編集履歴

1

コメントの追記

2022/10/13 07:10

投稿

developer1223
developer1223

スコア6

test CHANGED
@@ -7,6 +7,7 @@
7
7
  @PostMapping("/employeeDetail/{id}/update")
8
8
  public String postUpdate(@Validated Employee employee,BindingResult bindingResult,RedirectAttributes attributes,Model model,@PathVariable("id") String id) {
9
9
  if (bindingResult.hasErrors()) {
10
+ //idを基に従業員情報を取得する
10
11
       employee = empService.selectOne(id);
11
12
       attributes.addFlashAttribute("org.springframework.validation.BindingResult.employee", bindingResult);
12
13
  attributes.addFlashAttribute("employee", employee);