
springboot
tensorhyt
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
springboot-本地化(LOCAL)
1.编写本地化配置文件,格式: filename.properties: login.btn=登陆 login.password=密码 login.remember=记住我 login.tip=请登陆 login.username=用户名 filename_en_US.properties: login.btn=Sign In login.password=Password login.remember=Remember Me login.tip=Please sign in login.usernam原创 2020-11-29 18:18:59 · 1607 阅读 · 0 评论 -
静态资源引用
当通过jar包将springboot项目封装成可执行文件时,静态资源文件有以下定位方式: 1.引用jQuery、bootstrap等框架文件,可在webjars官网找到相应的依赖关系,复制到pom.xml中。 <dependency> <groupId>org.webjars</groupId> <artifactId>jquery</artifactId> <vers原创 2020-11-18 16:54:02 · 611 阅读 · 0 评论 -
springboot学习(6)-日志配置
1.boot中通过slf4j+logback实现了日志的统一管理,目的可以规避掉多个项目中所使用日志框架不一致问题 2.当引入新项目时需要在配置文件中将使用的日志框架剔除 3.springboot日志框架调用参考: Logger logger= LoggerFactory.getLogger(getClass()); @Test void contextLoads() { l...原创 2020-01-12 21:59:48 · 713 阅读 · 0 评论 -
springboot学习(5)-自动配置原理理解
说明:理解自动配置原理可以更好的进行自动配置类参数的调整 1.在springboot启动类中点击@SpringBootApplication查看注解信息,如下: @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfiguration //启用自动配...原创 2020-01-11 20:53:22 · 383 阅读 · 0 评论 -
springboot学习(4)-批量激活不同运行环境参数,springboot配置文件加载顺序,springboot外部文件的加载顺序
可以通过一下两种方式来配置springboot不同运行环境下参数: 方式1.application-{profile}.properties 建立profile文件在其中配置相应的参数,结构如下: a. 参数配置参考如下: application-dev.properties #server.port=8083 b. 在application.properties中激活参数: #server...原创 2020-01-11 15:37:34 · 211 阅读 · 0 评论 -
springboot学习(3)-配置文件的导入:PropertySource、ImportResource、Configuration
PropertySource:读取指定的配置文件,位置需要引用配置文件的地方,注意配合ConfigurationProperties进行内容的引用: @ConfigurationProperties(prefix ="person") @PropertySource(value = {"classpath:person.properties"}) @Component public class P...原创 2020-01-02 20:50:24 · 199 阅读 · 0 评论 -
springboot学习(2)-springinitializr,yml
使用springinitializr建立的项目结构如下: pname src main java resources static 保存静态资源例如:css,js,image, templates springboot默认使用内嵌tom...原创 2020-01-02 20:38:39 · 186 阅读 · 0 评论 -
springboot学习(1)-SpringBootApplication
@SpringBootApplication //springboot主程序 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(exclude...原创 2019-12-19 20:55:30 · 164 阅读 · 0 评论