What is the difference between below two attributes and which one to use when?
@GetMapping(path = \"/usr/{userId}\")
@GetMapping is an alias for @RequestMapping
@GetMapping is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.GET).
value method is an alias for path method.
This is an alias for path(). For example @RequestMapping("/foo") is equivalent to @RequestMapping(path="/foo").
So both methods are similar in that sense.