1
Short answer
There is no difference in semantics
Specifically, @Getmapping a compound notation that acts as a shortcut to @Requestmapping (method = Requestmethod.GET).
Additional reading:
RequestMapping
can be used at class level:
This annotation can be used both in the class and at the method level. In most cases, at the method level, applications will prefer to use one of the specific variants of the HTTP @Getmapping, @Postmapping, @Putmapping, @Deletemapping or @Patchmapping method.
while GetMapping
only applies to the method:
Notation for mapping HTTP GET requests into specific manipulative methods.
Reading documentation:
Josemar, you better put the code in place of the code image
– Jefferson Quesado
Thanks for the tip, but I thought it was best to leave the image. But thanks for the tip. It seems to be more visible but all right and thanks.
– Josemar Sabino