摘要:
在主配置类中添加: Logger logger =LoggerFactory.getLogger(HelloworldApplicationTests.class); @Test public void test_log(){ logger.trace("trace******"); logger. 阅读全文
摘要:
properties和yml中的配置,相互补充;如果冲突,则properties优先级高。 spring boot默认能够读取的application.properties/application.yml,这两个文件可以存在于一下四个位置: file:项目根目录/config file:项目根目录 阅读全文
摘要:
一、使用properties设置多环境 创建多个properties文件; application-dev.properties:(开发环境) server.port=8883 application-test.properties:(测试环境) server.port=8884 applictio 阅读全文
摘要:
一、@ImportResource spring boot自动装配/自动配置 Spring 扥配置文件 默认会被spring boot自动给配置好。 如果要自己编写spring等配置文件,spring boot能否识别? 当然是可以的。 在resources目录下创建spring.xml文件。 <b 阅读全文
摘要:
一、 java.lang.Exception: The class com.doublechen.helloworld.HelloworldApplicationTests is not public. 这个错误解决: 加上public。 二、 java.lang.Exception: No run 阅读全文