
springframework
JAVA探索
对知识的贪婪是我前进的动力
展开
-
bean的生命周期
参照BeanFactory的类注释* <p>Bean factory implementations should support the standard bean lifecycle interfaces * as far as possible. The full set of initialization methods and their standard order is: * <ol> * <li>BeanNameAware's {@code s原创 2020-07-09 02:42:03 · 173 阅读 · 0 评论 -
spring学习备忘录
xml文件是否是activeProfile的设置<?xml version="1.0" encoding="UTF-8"?><beans profile="dev" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springf原创 2020-07-08 23:58:15 · 759 阅读 · 0 评论 -
bean注解和标签同时存在时,标签会覆盖注解
bean注解和标签同时存在时,标签会覆盖注解原创 2020-04-01 16:24:57 · 445 阅读 · 0 评论 -
spring bean标签属性
1.id 指定bean唯一标识 可通过@Qualifier(id)来注入指定的beaneg:这个时候注入的是redisTemplateStringRedisSerializer<bean id="redisTemplateStringRedisSerializer" class="org.springframework.data.redis.core.RedisTemplate" ...原创 2020-03-30 15:23:01 · 187 阅读 · 0 评论 -
springmvc框架 controller层获取不到@Value的值
原因: 只在applicationContext中添加了扫描,没有在SpringMVC对应的配置文件中扫描。解决:在srping-mvc.xml 中添加<context:property-placeholder location="classpath:config.properties" ignore-unresolvable="true" />...原创 2020-03-14 20:25:20 · 834 阅读 · 1 评论 -
spring 事务@Transactional 注解参数概要
1.可配置的参数列表属性 类型 描述 传播性 枚举型:Propagation 可选的传播性设置 隔离性 枚举型:Isolation 可选的隔离性级别(默认值:ISOLATION_DEFAULT) 只读性 布尔型 读写型事务 , 只读型事务 超时 int型(秒) 事务超时 回滚异常类(rollbackFor) ...原创 2018-11-01 11:27:55 · 868 阅读 · 0 评论 -
SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
问题编译时报错:java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/**]]Caused b...原创 2019-12-05 14:35:29 · 634 阅读 · 0 评论 -
aspectjweaver AspectJ
基于aop的依赖jar包,可以实现切面过滤拦截。依赖包:<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver --><dependency> <groupId>org.aspectj</groupId> <artifactId>asp...原创 2019-11-26 17:24:42 · 2374 阅读 · 0 评论 -
StopWatch 时间记录器
StopWatch是springframework框架提供的时间记录器。通常,如果我们想要记录一段程序的时间是这样的: long time1 = System.currentTimeMillis(); Thread.sleep(200L); long time2 = System.currentTimeMillis(); Sy...原创 2019-11-25 18:12:13 · 395 阅读 · 2 评论