Issue
Is it possible to use multiple @RequestMapping
annotations over a method?
Like :
@RequestMapping("/")
@RequestMapping("")
@RequestMapping("/welcome")
public String welcomeHandler(){
return "welcome";
}
Solution
@RequestMapping
has a String[]
value parameter, so you should be able to specify multiple values like this:
@RequestMapping(value={"", "/", "welcome"})
Answered By - Ed Brannin
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)