Some scenarios require JDK proxy, but the controller cannot be registered if JDK proxy is used. I have seen the problem mentioned in the previous issue, but the solution is to have the user change the configuration to force the cglib proxy to be enabled. I think this is not a good solution.
Comment From: rstoyanchev
For JDK proxies, annotations are expected on the interface. We have JdkProxyControllerTests that tests this.
Comment From: wangkaijin
@rstoyanchev My English is not very good, do you mean that I need to execute the JdkProxyControllerTests test class? I have already passed the JdkProxyControllerTests test locally
Comment From: rstoyanchev
What I mean is that this is a feature and not a bug. Annotations need to be on the interface and JdkProxyControllerTests is just an example of where we test this to make sure it works as expected.
Please, check the documentation: https://docs.spring.io/spring-framework/docs/5.3.8/reference/html/web.html#mvc-ann-requestmapping-proxying