[Spring] Private methods in @Controller cannot access @Autowired beans

The phenomenon is shown in the figure:


In fact, the autowired attributes in the beans obtained from the beanfactory are all empty, but when running at runtime, the proxy method is used, and the attributes are obtained through Dynamicxxxxxx.getTarget(), so the reason why there is no private method here Going to the public part, it should be that the cglib dynamic proxy handles the proxy processing of the private method in the class differently. Check the cglib proxy related. Just change the method to public. Accidentally annoyed wrong.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325440139&siteId=291194637