上一页 1 2 3 4 5 6 7 ··· 24 下一页

2019年1月8日

Spring 梳理 - filter、interceptor、aop实现与区别 -第二篇

摘要: spring mvc中的Interceptor可以理解为是Spring MVC框架对AOP的一种实现方式。一般简单的功能又是通用的,每个请求都要去处理的,比如判断token是否失效可以使用spring mvc的HanlderInterceptor, 复杂的,比如缓存,需要高度自定义的就用spring 阅读全文

posted @ 2019-01-08 22:35 手握太阳 阅读(2954) 评论(0) 推荐(0) 编辑

Spring 梳理 - filter、interceptor、aop实现与区别 -第一篇

摘要: 前言项目中我们经常需要对RESTful api进行拦截,主流实现方法有filter、interceptor、aop,先说一下他们各自的实现。FilterAnimalFilter实现javax.servlet.Filter,项目启动时已初始化完成,可在控制台看到打印的初始化日志。 @Component 阅读全文

posted @ 2019-01-08 22:34 手握太阳 阅读(1008) 评论(0) 推荐(1) 编辑

Spring boot 梳理 - WebMvcConfigurer接口 使用案例

摘要: 转:https://yq.aliyun.com/articles/617307 SpringBoot 确实为我们做了很多事情, 但有时候我们想要自己定义一些Handler,Interceptor,ViewResolver,MessageConverter,该怎么做呢。在Spring Boot 1.5 阅读全文

posted @ 2019-01-08 22:05 手握太阳 阅读(1181) 评论(0) 推荐(0) 编辑

Spring boot 梳理 - @Conditional

摘要: @Conditional(TestCondition.class) 这句代码可以标注在类上面,表示该类下面的所有@Bean都会启用配置,也可以标注在方法上面,只是对该方法启用配置。 spring框架还提供了很多@Condition给我们用,当然总结用语哪种好理解,看给位读者喽 @Conditiona 阅读全文

posted @ 2019-01-08 21:51 手握太阳 阅读(390) 评论(0) 推荐(0) 编辑

Spring boot 梳理 -@SpringBootApplication、@EnableAutoConfiguration与(@EnableWebMVC、WebMvcConfigurationSupport,WebMvcConfigurer和WebMvcConfigurationAdapter)

摘要: @EnableWebMvc=继承DelegatingWebMvcConfiguration=继承WebMvcConfigurationSupport 直接看源码,@EnableWebMvc实际上引入一个DelegatingWebMvcConfiguration @Retention(Retentio 阅读全文

posted @ 2019-01-08 21:28 手握太阳 阅读(1395) 评论(0) 推荐(0) 编辑

2019年1月5日

Spring 梳理 - 开启并配置 Spring MVC 的方法

摘要: 参考本人另外一篇文章 SPI/SCI/SpringSCI/WebApplicationInitializer/WebMvcConfigurerAdapter 阅读全文

posted @ 2019-01-05 23:01 手握太阳 阅读(153) 评论(0) 推荐(0) 编辑

2019年1月3日

Spring boot 梳理 - mappingJackson2JsonView

摘要: MappingJacksonJsonView已被废弃了: http://static.javadoc.io/org.springframework/spring-webmvc/4.0.1.RELEASE/deprecated-list.html 而升级为MappingJackson2JsonView 阅读全文

posted @ 2019-01-03 21:39 手握太阳 阅读(2779) 评论(0) 推荐(0) 编辑

Spring boot 梳理 - 显示Springboot默认自动生成的bean

摘要: @Autowired public ApplicationContext context; @Bean public ViewResolver freeMarkerViewResolver(){ String[] arr=context.getBeanDefinitionNames(); for(int i=0;i<arr.lengt... 阅读全文

posted @ 2019-01-03 20:56 手握太阳 阅读(990) 评论(0) 推荐(0) 编辑

2019年1月1日

Spring boot 梳理 - 模版引擎 -freemarker

摘要: 开发环境中关闭缓存 spring: thymeleaf: cache: false freemarker: cache: false Spring boot 集成 freemarker org.springframework.boot spring-boot-starter... 阅读全文

posted @ 2019-01-01 22:03 手握太阳 阅读(155) 评论(0) 推荐(0) 编辑

Spring boot 梳理 - Spring boot 与 JSP

摘要: 若使用Spring boot 开发web应用中使用jsp,需要打包成war,并部署到非嵌入式servlet容器中运行,在嵌入式servlet中无法运行,且需要匹配非嵌入式servlet版本与Spring boot开发中的版本一致性 阅读全文

posted @ 2019-01-01 22:01 手握太阳 阅读(278) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 24 下一页

导航