维多利亚睡莲上的绿鹭,潘塔纳尔 ,巴西 (© Gerald Corsi/Getty Images)

分类 Java 下的文章

August 21, 2021

spring-boot不同包结构下,同名类冲突导致服务启动失败解决方案

spring提供两种beanName生成策略,基于注解的sprongboot默认使用的是AnnotationBeanNameGenerator,它生成beanName的策略就是,取当前类名(不是全限定类名)作为beanName。由此,如果出现不同包结构下同样的类名称,肯定会出现冲突。解决方法如下:一、自己写一个类实现 org.springframework.beans.factory.sup...
August 20, 2021

spring mvc中的几类拦截器对比

主要分Filter及interceptorFilter是servlet规范中的Filter,spring中有一个基本的实现叫做org/springframework/web/filter/GenericFilterBean.javapublic abstract class GenericFilterBean implements Filter, BeanNameAware,...
March 18, 2021

Spring Boot定时任务

开启定时任务在项目启动类上添加@EnableScheduling注解,开启对定时任务的支持@SpringBootApplication @EnableScheduling public class ScheduledApplication { public static void main(String[] args) { SpringApplication.run...