@ RequestMapping is placed on the interface, why can springmvc be mapped to its implementation?

springboot
define an interface

public interface HelloController {

 @RequestMapping("/hello")
 String hello();

}

then implement

@ RestController
public class HelloControllerImpl implements HelloController {

 @Override
 public String hello(){
     return "hello";
 }

}

@ RequestMapping should not be inherited by the method in HelloControllerImpl. How does it work?


this is the dynamic proxy for jdk.
spring makes HelloControllerImpl bean when initializing. Then and HelloController as the id number.
calls the hello method of HelloController each time. The hello method of HelloControllerImpl is called through the dynamic proxy of jdk

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be9025-31963.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be9025-31963.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?