springboot
dfcdsfv
观众
展开
-
springboot学习笔记8-1启动原理(springboot2.3.1版本)
通过查看springboot主配置类的main方法中,调用的是springApplication中的静态的run方法 @SpringBootApplication public class SpringbootWebRestfulcrudApplication { public static void main(String[] args) { SpringApplication.run(SpringbootWebRestfulcrudApplication.class, args原创 2020-07-01 23:49:35 · 248 阅读 · 0 评论 -
springboot学习笔记7数据访问(1)jdbc及自动配置原理
配置数据源 spring: datasource: password: root url: jdbc:mysql://127.0.0.1:3306/supermarket?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC username: root driver-class-name: com.mysql.cj.jdbc.Driver 高版本驱动访问低原创 2020-06-29 18:46:51 · 172 阅读 · 0 评论 -
SpringBoot学习笔记6web开发(6)嵌入式servlet容器操作
SpringBoot学习笔记—Day10 1.如何定制和修改servlet有关配置 在配置文件中, 配置server有关配置,其映射的类是ServerProperties, 例如:配置虚拟路径 server.servlet.context-path=/web 在配置类中添加这样一个组件一样可以达到效果 @Bean public WebServerFactoryCustomizer webServerFactoryCustomizer(){ return new WebServ原创 2020-06-26 22:11:36 · 143 阅读 · 0 评论 -
SpringBoot学习笔记6web开发(5)错误处理机制(spring2.3.1版本可能存在的bug)
SpringBoot学习笔记—Day09 springboot 有一个默认的处理机制,ErrorMvcAutoConfiguration是SpringBoot处理错误的核心配置类,其中有4个负责处理错误的组件 @Bean @ConditionalOnMissingBean(value = ErrorAttributes.class, search = SearchStrategy.CURRENT) public DefaultErrorAttributes errorAttributes() {原创 2020-06-26 13:49:31 · 318 阅读 · 0 评论 -
SpringBoot学习笔记6web开发(4)自动类型转换
SpringBoot学习笔记—Day08 自动配置类型转换器 在WebMvcAutoConfiguration类中有addFormatters方法 @Override public void addFormatters(FormatterRegistry registry) { ApplicationConversionService.addBeans(registry, this.beanFactory); } public static void addBeans(Formatter原创 2020-06-24 23:04:25 · 213 阅读 · 1 评论 -
SpringBoot学习笔记6web开发(3)
SpringBoot学习笔记—Day07 国际化 首先先编写国际化配置文件 在Resource Bundle视图中写更加方便原创 2020-06-24 09:27:05 · 107 阅读 · 0 评论 -
SpringBoot学习笔记6web开发(2)
SpringBoot学习笔记—Day06 SpringMVC的自动配置 Inclusion of ContentNegotiatingViewResolver and BeanNameViewResolver beans. 自动配置了ViewResolver(视图解析器:根据方法的返回值得到视图对象(View),视图对象决定如何 渲染(转发?重定向?)) 给容器中添加视图解析器的方法 @Bean @ConditionalOnBean(ViewResolver.class) @Conditiona原创 2020-06-23 10:57:25 · 185 阅读 · 0 评论 -
SpringBoot学习笔记6web开发(1)
SpringBoot学习笔记—Day05 使用spring boot: 1.) 创建springboot应用选择我们需要的模块 2.) springboot已经将我们选中的场景配置好了,只需要少量的配置就可以使用 3.) 自己编写业务代码 自动配置原理? 这个场景sprigboot帮我们配置了什么? 能不能修改? 能修改哪些配置? 能不能扩展? xxxxAutoConfiguration //给容器中自动添加组件的类 xxxxProperties //配置类中来封装配置文件的内容的类 springboot原创 2020-06-21 13:06:02 · 785 阅读 · 0 评论 -
SpringBoot学习笔记5日志部分
SpringBoot学习笔记—Day04 1.日志框架 日志框架的种类很多。JUL(java.util.logging),JCL(Apache Commons Logging),Log4j,Log4j2,Logback、SLF4j、jboss-logging等。 Spring Boot在框架内容部使用JCL,spring-boot-starter-logging采用了 slf4j+logback的形式,Spring Boot也能自动适配(jul、log4j2、logback) 并 简化配置 日志门面原创 2020-06-20 15:34:16 · 281 阅读 · 0 评论 -
SpringBoot学习笔记4有关@Conditional注解部分
SpringBoot学习笔记—Day04 Conditional注解原生(及其派生注解)的conditional作用 @Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented @Conditional(OnClassCondition.class) public @interface ConditionalOnClass { @Order(Ordered.HIGHEST原创 2020-06-19 10:24:24 · 163 阅读 · 0 评论 -
SpringBoot学习笔记3配置文件加载及自动配置原理
SpringBoot学习笔记—Day03 配置文件加载位置 spring boot 启动会扫描以下位置的application.properties或者 application.yml文件作为Spring boot的默认配置文件 – file:./config/ – file:./ – classpath:/config/ – classpath:/ – 以上是按照优先级从高到低的顺序,所有位置的文件都会被加载,高优先 级配置内容会覆盖低优先级配置内容。这些位置的配置文件全部加载,互补配置,相同内容高优先级原创 2020-06-18 22:41:18 · 324 阅读 · 2 评论 -
SpringBoot学习笔记1简单了解
SpringBoot学习笔记---Day01SpringBoot主程序入口注解@SpringBootApplication1.@SpringBootConfiguration2. @EnableAutoConfiguration如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导原创 2020-06-17 09:49:15 · 270 阅读 · 1 评论