@Controller @RequestMapping("/springmvc/v1/") public class SpringMemberListControllerV1 {
private final MemberRepository memberRepository = MemberRepository.getInstance(); @RequestMapping("members") // 혹은 @GetMapping("members") public ModelAndView process() {
List<Member> members = memberRepository.findAll(); ModelAndView mv = new ModelAndView("members"); mv.addObject("members", members); return mv; }
다음과 같이 지정해줘야합니다.