ToDoController.java1(R)

背景
投稿者投稿者jumokuいいね0お気に入り登録
プレイ回数59難易度(3.3) 628打 英語 英字 長文モードのみ
src/main/java
com.example.webapp.controller

関連タイピング

問題文

ふりがな非表示 ふりがな表示

(@Controller)

@Controller

(@RequestMapping("/todos"))

@RequestMapping("/todos")

(@RequiredArgsConstructor)

@RequiredArgsConstructor

(public class ToDoController {)

public class ToDoController {

(private final ToDoService toDoService;)

private final ToDoService toDoService;

(//read)

//read

(@GetMapping)

@GetMapping

(public String list(Model model) {)

public String list(Model model) {

(model.addAttribute("todos", toDoService.findAllToDo());)

model.addAttribute("todos", toDoService.findAllToDo());

(return "todo/list";)

return "todo/list";

(})

}

(//read(detail))

//read(detail)

(@GetMapping("/{id}"))

@GetMapping("/{id}")

(public String detail(@PathVariable("id") Integer id, Model model,)

public String detail(@PathVariable("id") Integer id, Model model,

(RedirectAttributes attributes) {)

RedirectAttributes attributes) {

(ToDo ToDo = toDoService.findByIdToDo(id);)

ToDo ToDo = toDoService.findByIdToDo(id);

(if (ToDo != null) {)

if (ToDo != null) {

(model.addAttribute("todo", toDoService.findByIdToDo(id));)

model.addAttribute("todo", toDoService.findByIdToDo(id));

(return "todo/detail";)

return "todo/detail";

(} else {)

} else {

など

(attributes.addFlashAttribute("errorMessage", "taishoude-tagaarimasenn");)

attributes.addFlashAttribute("errorMessage", "taishoude-tagaarimasenn");

(return "redirect:/todos";)

return "redirect:/todos";

(})

}

(})

}

問題文を全て表示 一部のみ表示 誤字・脱字等の報告