spring加载类的顺序

spring @Order标记

order标签是用来指定加载bean的顺序,数字越小越先加载。

其中的spring的xml配置文件,内容完善一下。在使用标签<context:component-scan/>的情况下,是不需要<context:annotation-config />

原因参考:SpringMVC - context:annotation-config与mvc:annotation-driven和context:component-scan


用ApplicationContext接口的实现类加载xml文件的时候,classpath究竟是什么?——classpath就是项目编译后的class的存放路径。

怎样更优雅?

参考文档:Spring如何利用classpath通配符加载配置文件

                 java项目中Classpath路径到底指的是哪里?

                


猜你喜欢

转载自blog.csdn.net/qq_42072311/article/details/80333885