• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Mapping by using Interface  RSS feed

 
Ranch Hand
Posts: 1320
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

using Spring Boot I have written a Class (Controller). This Class signature holds a @RequestMapping("path") annotation, and implements an Interface which contains another  @RequestMapping("path") annotation like this;



This Interface contained annotation is holded by a method.

Ths issue is that I reach the Class (from a Rest call) but the Interface method doesnt get reached.

This part of the code is not "reading" the Rest call.
 
Saloon Keeper
Posts: 9986
206
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Annotations are only inherited by sub-classes if the annotation itself is annotated with the meta-annotation @Inherited, which @RequestMapping is not. Besides, @Inherited only works when the annotated annotation applies to a class, not to interfaces.

In short, annotations on an interface are not inherited.
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!