currently my Controller looks like this.
@RequestMapping("members") public class MembersController { private ArrayList<Member> memberList = new ArrayList<>(); @GetMapping("") public String index1(Model model) { model.addAttribute(memberList); return "members/memberIndex"; } @GetMapping("index") public String index2(Model model) { model.addAttribute(memberList); return "members/memberIndex"; } }
Is there a easier way to have one index-method for two different paths "localhost:port/members" & "localhost:port/members/index"? Can I annotate two values for one method in general?
Thanks in advance :)
Edit: I have seen it work for @RequestMapping