
Spring
秀强
物有本末,事有终始。
展开
-
spring aop 修改请求参数实体类属性的值
文章目录创建注解定义 Pointcut定义 advise总结创建注解@Target(ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)public @interface AuthChecker {}定义 Pointcut @Pointcut("@annotation(com.xxx.annotation.AuthChecker)") public void pointcut() { }定义 advise原创 2022-02-17 16:48:02 · 2658 阅读 · 0 评论 -
Spring 非懒加载 Bean 生命周期源码分析
文章目录 /** * Create a new AnnotationConfigApplicationContext, deriving bean definitions * from the given annotated classes and automatically refreshing the context. * @param annotatedClasses one or more annotated classes, * e.g. {@link Configuratio原创 2020-05-14 17:33:10 · 959 阅读 · 0 评论 -
图解Spring源码之循环依赖
文章目录准备工作关闭循环依赖Spring默认在单例、非构造方法注入的情况下是支持循环依赖的。准备工作关闭循环依赖Spring 提供了关闭循环依赖的方法。boolean allowCircularReferences...原创 2020-05-05 03:28:21 · 604 阅读 · 0 评论 -
Spring之Bean的作用域及配置方式
文章目录singletonprototyperequestsessionapplication小结Bean 的作用域一共有 5 个。singletonsingleton 作用域:表示在 Spring 容器中只有一个 Bean 实例,以单例的形式存在,是默认的 Bean 作用域。配置方式,缺省即可,XML 的配置方式如下:<bean class="..."></bean&...原创 2020-05-03 01:43:48 · 427 阅读 · 0 评论 -
Could not read document: Cannot deserialize value of type `java.util.Date` from String
文章目录现象解决现象 @ResponseBody @RequestMapping("/ooxx/save") public ResultStatus saveOOxx(@RequestBody ooxx ooxx, HttpSession session, Model model) {}后台接受实体类时,报错[WARN](2020-04-20 16:43:59,04...原创 2020-04-20 16:49:10 · 1610 阅读 · 0 评论 -
Spring 事务 传播行为 隔离级别
文章目录传播行为REQUIREDREQUIRES_NEWSUPPORTSNOT_SUPPORTEDMANDATORYNEVERNESTED数据库事务并发问题脏读不可重复读幻读隔离级别读未提交读已提交可重复读串行化各个隔离级别解决并发问题的能力传播行为REQUIRED如果有事务在运行,当前的方法就在这个事务内运行,否则,就启动一个新的事务,并在自己的事务内运行。REQUIRES_NEW当前...原创 2020-03-27 11:38:56 · 315 阅读 · 0 评论 -
Spring 图片上传
文章目录准备工作springmvc.xmlHTMLJavaScriptController准备工作Tomcat虚拟地址映射springmvc.xml在springmvc.xml中配置文件上传解析器<!-- 文件上传,id必须设置为multipartResolver --><bean id="multipartResolver" class="org.spring...原创 2020-03-10 11:30:22 · 700 阅读 · 0 评论 -
Spring @Value注解使用
文章目录在ApplicationContext.xml中配置创建配置文件 imgConfig.properties使用@Value获取属性在ApplicationContext.xml中配置 <bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"...原创 2020-03-05 15:22:49 · 380 阅读 · 0 评论