Spring的application.properties (application.yml)的属性值参考 https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html # =================================================================== # COMMON SP ...
阅读全文在使用spring boot 来new一个springApplication时会读取classpath中的 META-INF/spring.factories中定义的Spring Factories. 比如ApplicationContextInitializers和ApplicationListeners. 下面是spring-boot-2.1.6.RELEASE.jar中默认的spring.factories # PropertySource Loaders org.spring ...
阅读全文在使用IDEA开发Spring Boot application时,如果使用Devtools依赖包时,可以配置automake来实现文件修改后自动build,deploy并不手动重启server的情况下测试改动。配置如下: 1) create Spring Boot project with SB V1.3 and add "Devtools" (1*) to dependencies 2) invoke Help->Find Action... and t ...
阅读全文Spring中Configuration的使用和理解,转载这篇文章写的挺清晰的文章 https://my.oschina.net/wuweixiang/blog/1837294 从Spring3.0,@Configuration用于定义配置类,可替换xml配置文件,被注解的类内部包含有一个或多个被@Bean注解的方法,这些方法将会被AnnotationConfigApplicationContext或AnnotationConfigWebApplication ...
阅读全文Spring configuration property的优先级官方说明:https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-external-config Externalized Configuration Spring Boot lets you externalize your configuration so that you can ...
阅读全文spring-boot-autoconfigure-2.1.4.release.jar下的spring-autoconfigure-metadata.properties #Thu Apr 04 02:08:30 GMT 2019 org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration.AutoConfigureAfter=org.springframework.b ...
阅读全文在spring boot 中使用annotation 配置web.xml中的信息时,不用担心RequestMapping的Url pattern重复,因为在启动 server的时候就会初始化RequestMappingHandlerMapping,会自动检测是否有重复的url mapping. 比如下面的异常就是因为有重复的url mapping: /{version}/hello org.springframework.beans.factory.BeanCrea ...
阅读全文Let us begin by defining some central AOP concepts and terminology. These terms are not Spring-specific... unfortunately, AOP terminology is not particularly intuitive; however, it would be even more confusing if Spring used its own terminology. ...
阅读全文从Spring-core-5.1.9.RELEASE.jar中分析Spring的IoC和AOP技术实现依赖。 从下图中可以看到有三个第三方lib被repack到spring-core中来,分别是asm, cglib,和 objenesis. asm主要用在支持aspectJ的AOP,cglib主要用来实现的类的动态代理,从而进一步实现AOP,objenesis用来类的实例化。 IoC的实现主要靠java的反射机制来实现,结合了Annotation和XML来 ...
阅读全文Besides ApplicationContextAware and BeanNameAware (discussed earlier), Spring offers a wide range of Aware callback interfaces that let beans indicate to the container that they require a certain infrastructure de ...
阅读全文