上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页
摘要: 1、springmvc的自动配置 文档:https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#boot-features-spring-mvc WebMvcAutoConfiguration.java 阅读全文
posted @ 2020-03-15 16:17 Arbitrary233 阅读(233) 评论(0) 推荐(0)
摘要: 模板引擎有:JSP、Velocity、Freemarker、Thymeleaf 等..... 对于模板引擎,SpringBoot(springboot使用的是嵌入式的tomcat所以不支持jsp)推荐的Thymeleaf; 1)、引入thymeleaf (thyme:百里香,leaf:叶子 thym 阅读全文
posted @ 2020-03-15 14:50 Arbitrary233 阅读(621) 评论(0) 推荐(0)
摘要: 对静态资源映射的映射类配置: public void addResourceHandlers(ResourceHandlerRegistry registry) { if (!this.resourceProperties.isAddMappings()) { logger.debug("Defau 阅读全文
posted @ 2020-03-15 14:47 Arbitrary233 阅读(363) 评论(0) 推荐(0)
摘要: 一、主流的日志框架介绍 二、springboot中SLF4J的使用 如何在系统中使用SLF4j https://www.slf4j.org 以后开发的时候,日志记录方法的调用,不应该来直接调用日志的实现类,而是调用日志抽象层里面的方法; 如下图: 每一个日志的实现框架都有自己的配置文件。 使用slf 阅读全文
posted @ 2020-03-14 20:10 Arbitrary233 阅读(470) 评论(0) 推荐(0)
摘要: 一.外部配置加载顺序 SpringBoot也可以从以下位置加载配置; 优先级从高到低 高优先级的配置覆盖低优先级的配置,所有的配置会形成互补配置 1.命令行参数 所有的配置都可以在命令行上进行指定 先打包在进行测试 java -jar spring-boot-02-config-02-0.0.1-S 阅读全文
posted @ 2020-03-13 22:45 Arbitrary233 阅读(1259) 评论(0) 推荐(0)
摘要: 1.配置文件占位符 RaandomValuePropertySourcr:配置文件可以使用随机数 ${random.value} ${random.int} ${random.long} ${random.int(10)} ${random.int[1024,65535]} 属性配置占位符 -可以在 阅读全文
posted @ 2020-03-13 21:59 Arbitrary233 阅读(1565) 评论(0) 推荐(0)
摘要: servlet3.0异步: 加上asyncSupported=true使支持异步 package com.atguigu.servlet; import java.io.IOException; import javax.servlet.AsyncContext; import javax.serv 阅读全文
posted @ 2020-03-12 15:40 Arbitrary233 阅读(435) 评论(0) 推荐(0)
摘要: 一、servlet3.0规范 1、新增的注解支持 在servlet3.0之前的话,我们要添加Servlet、Filter、Listener都需要在web.xml中注册,而在servlet3.0添加了注解支持: @WebServlet: 用于将一个类声明为 Servlet,该注解将会在部署时被容器处理 阅读全文
posted @ 2020-03-12 15:25 Arbitrary233 阅读(446) 评论(0) 推荐(1)
摘要: 一、总体流程 AnnotationConfigApplicationContext类的构造器方法 public AnnotationConfigApplicationContext(Class<?>... componentClasses) { this(); register(componentC 阅读全文
posted @ 2020-03-12 14:41 Arbitrary233 阅读(280) 评论(0) 推荐(0)
摘要: 1、扩展原理-BeanFactoryPostProcessor BeanFactoryPostProcessor * 扩展原理: * BeanPostProcessor:bean后置处理器,bean创建对象初始化前后进行拦截工作的 * * 1、BeanFactoryPostProcessor:bea 阅读全文
posted @ 2020-03-12 14:27 Arbitrary233 阅读(442) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 30 下一页