ITeye博客

spring

共 6 篇文章

Spring常见的注解总结

哎哎哎,来荔枝后,web方面较少了好多!之前做开发时,大多数注解都是熟悉的,可是就是说不出来,这里做一个整理,方便后续查看。 Swagger中paramType: paramType:表示参数放在哪个地方 header-->请求参数的获取:@RequestHeader(代码中接收注解) query-->请求参数的获取:@RequestParam(代码中接收注解) path(用于restful接口)-->请求参数的获取:@PathVariable(代码中接收注解) body-->请求参数的获取:@RequestBody(代码中接收注解) form(不常用) get请求的headers中没有co…

2018-09-11 14:39 · spring

spring循环依赖错误

当在出现循环依赖的 Spring Bean 中使用 @Async 时,会报以下错误: Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'a': Bean with name 'a' has been injected into other beans [b] in its raw version as part of a circular reference, but has eventually been wrapped.…

2018-08-14 14:55 · spring

spring各知识点

1、通过在JVM传参数-Dconfig.env=dev,在配置文件或代码中可获取${config.env},另外操作系统环境变量,自定义配置文件xx.properties等也是同理。

2018-02-22 10:07 · spring

Spring集成Quartz定时任务框架介绍和Cron表达式

可参考: 总共有两个重点: 1:JobDetailFactoryBean:即需要调度的job描述,一般用MethodInvokingJobDetailFactoryBean和JobDetailFactoryBean比较多。 2:触发器:用来调度任务的,其参数是调度job的JobDetailFactoryBean。 其中配置如下: <!--<bean id="firstJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targe…

2017-06-20 11:10 · spring

spring容器初始化bean和销毁前做操作

关于在spring容器初始化bean和销毁前所做的操作定义方式有三种: 第一种:通过@PostConstruct 和 @PreDestroy 方法 实现初始化和销毁bean之前进行的操作 第二种是:通过 在xml中定义init-method 和 destory-method方法 第三种是: 通过bean实现InitializingBean和 DisposableBean接口 待研究。。。

2017-02-08 11:21 · spring

spring的aop

一、基于注解的aop编程: 1)需要的jar包,pom.xml: <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.7.1</version> </dependency> <dependency> <groupId>org.aspe…

2016-12-07 19:02 · spring