Win a copy of Java XML & JSON this week in the XML and Related Technologies forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Mapping by using Interface  RSS feed

 
Ranch Hand
Posts: 1298
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: 9703
192
  • 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 giving us the slip! Quick! Grab this tiny ad!
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!