The Java Language Spec states
It is legal to use single-element annotations for annotation types with multiple elements, so long as one element is named value, and all other elements have default values.
Since @RequestMapping
has a defined value
attribute and all other attributes have default values (empty arrays), it is always legal to omit spelling the name value
if you don't specify any other attributes for the annotation:
@RequestMapping("/somepath") // valid
@RequestMapping("/somepath", method = RequestMethod.GET) // INVALID!