- 浏览: 371240 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (760)
- 股票日志 (26)
- Selenium (0)
- selenium 2 环境的搭建 (1)
- 并发 (7)
- 框架开发 (1)
- 动态代理 (2)
- Struts2 (2)
- POI (2)
- jdk (3)
- maven (31)
- spring (35)
- mysql (31)
- 工作机会 (3)
- xtream (1)
- oracle dbms_metadata GET_DDL (0)
- SSI (1)
- DB (61)
- powermock (4)
- java 基础 (25)
- 多线程 (11)
- 高手 (2)
- java 底层 (2)
- 专业网站 (1)
- 开发联想 (1)
- 开发联想 (1)
- bat文件 (2)
- 清queue 语句 (1)
- 清queue 语句 (1)
- jquery (7)
- html5 (1)
- Jenkins (10)
- Linux (17)
- 工作issue (2)
- tomcat log (3)
- jvm (23)
- 项目细节 (0)
- oracle (41)
- 泛型 (3)
- 新知识点 (1)
- 数据库ddl 语句 (0)
- AQ (2)
- jms (0)
- 网络资源 (6)
- github (6)
- Easymock (1)
- Dom 解析XML (1)
- windows命令 (2)
- java (7)
- 正则表达式 (5)
- sequence (1)
- oracle 表meta信息 (1)
- 小工具技巧 (1)
- 辅助工具 (1)
- Junit (1)
- 泛型 generic (2)
- Java程序设计 (1)
- cglib (2)
- 架构师之路 (1)
- 数据库连接池 (5)
- c3p0 (1)
- eclipse使用 (1)
- oracle sql plus (1)
- 码农人生 (3)
- SVN (15)
- sqlplus (2)
- jsoup (1)
- 网络爬虫 (2)
- 新技能 (1)
- zookeeper (4)
- hadoop (1)
- SVNKIT (1)
- 从工具到知识点的整理 (1)
- log4j (13)
- 读文件 (0)
- 转义字符 (1)
- command (1)
- web service (3)
- 锁 (1)
- shell 脚本 (1)
- 遇到的错误 (2)
- tomcat (14)
- 房产 (5)
- bootstrap jquery ui (1)
- easyui (2)
- 个人征信 (1)
- 读写分离 (1)
- 备份 (1)
- rmi (6)
- webservice (1)
- JMX (4)
- 内存管理 (3)
- java设计 (1)
- timer (1)
- lock (2)
- concurrent (2)
- collection (1)
- tns (1)
- java基础 (15)
- File (1)
- 本机资源 (1)
- bat (1)
- windows (4)
- 数据结构 (3)
- 代码安全 (1)
- 作用域 (1)
- 图 (2)
- jvm内存结构 (1)
- 计算机思想 (1)
- quartz (6)
- Mongo DB (2)
- Nosql (4)
- sql (5)
- 第三方Java 工具 jar 项目 (2)
- drools (1)
- java swing (2)
- 调用console (1)
- runtime (1)
- process (1)
- swing (2)
- grouplayout (1)
- dubbo (0)
- bootstrap (0)
- nodejs (2)
- SVN hooks (1)
- jdbc (3)
- jdbc error (1)
- precedure (1)
- partition_key (1)
- active mq (1)
- blob (2)
- Eclipse (6)
- web server (1)
- bootstrapt (2)
- struts (1)
- ajax (1)
- js call back (1)
- 思想境界拓展 (1)
- JIRA (1)
- log (1)
- jaxb (3)
- xml java互相转换 (1)
- 装修 (2)
- 互联网 (2)
- threadlocal (3)
- mybatis (22)
- xstream (1)
- 排序 (1)
- 股票资源 (1)
- RPC (2)
- NIO (3)
- http client (6)
- 他人博客 (1)
- 代理服务器 (1)
- 网络 (2)
- web (1)
- 股票 (5)
- deadlock (1)
- JConsole (2)
- activemq (3)
- oralce (1)
- 游标 (1)
- 12月13日道富内部培训 (0)
- grant (1)
- 速查 (2)
- classloader (4)
- netty (4)
- 设计模式 (2)
- 缓存 (2)
- ehcache (2)
- framework (1)
- 内存分析 (2)
- dump (1)
- memory (2)
- 多高线程,并发 (1)
- hbase (2)
- 分布式系统 (1)
- socket (3)
- socket (1)
- 面试问题 (1)
- jetty (2)
- http (2)
- 源码 (1)
- 日志 (2)
- jni (1)
- 编码约定 (1)
- memorycache (1)
- redis (13)
- 杂谈 (1)
- drool (1)
- blockingqueue (1)
- ScheduledExecutorService (1)
- 网页爬虫 (1)
- httpclient (4)
- httpparser (1)
- map (1)
- 单例 (1)
- synchronized (2)
- thread (1)
- job (1)
- hashcode (1)
- copyonwriteArrayList (2)
- 录制声音 (1)
- java 标准 (2)
- SSL/TLS (1)
- itext (1)
- pdf (1)
- 钻石 (2)
- sonar (1)
- unicode (1)
- 编码 (4)
- html (1)
- SecurityManager (1)
- 坑 (1)
- Restful (2)
- svn hook (1)
- concurrentHashMap (1)
- 垃圾回收 (1)
- vbs (8)
- visual svn (2)
- power shell (1)
- wmi (3)
- mof (2)
- c# (1)
- concurrency (1)
- 劳动法 (1)
- 三国志游戏 (2)
- 三国 (1)
- 洪榕 (2)
- 金融投资知识 (1)
- motan (1)
- tkmybatis mapper (1)
- 工商注册信息查询 (1)
- consul (1)
- 支付业务知识 (2)
- 数据库备份 (1)
- 字段设计 (1)
- 字段 (1)
- dba (1)
- 插件 (2)
- PropEdit插件 (1)
- web工程 (1)
- 银行业知识 (2)
- 国内托管银行 (1)
- 数据库 (1)
- 事务 (2)
- git (18)
- component-scan (1)
- 私人 (0)
- db2 (14)
- alias (1)
- 住房 (1)
- 户口 (1)
- fastjson (1)
- test (6)
- RSA (2)
- 密钥 (1)
- putty (1)
- sftp (1)
- 加密 (1)
- 公钥私钥 (3)
- markdown (1)
- sweet (1)
- sourcetree (1)
- 好工具 (1)
- cmd (1)
- scp (1)
- notepad++ (1)
- ssh免密登录 (1)
- https (1)
- ssl (2)
- js (2)
- h2 (1)
- 内存 (2)
- 浏览器 (1)
- js特效 (1)
- io (1)
- 乱码 (1)
- 小工具 (1)
- 每周技术任务 (1)
- mongodb (7)
- 内存泄漏 (1)
- 码云 (2)
- 如何搭建java 视频服务器 tomcat (1)
- 资源 (1)
- 书 (1)
- 四色建模法 (1)
- 建模 (1)
- 配置 (1)
- 职位 (1)
- nginx (1)
- excel (1)
- log4j2 (2)
- 做菜 (1)
- jmap (1)
- jspwiki (1)
- activiti (1)
- 工作流引擎 (1)
- 安卓 (1)
- acitviti 例子 (1)
- 二维码 (1)
- 工作流 (1)
- powerdesign (2)
- 软件设计 (1)
- 乐观锁 (1)
- 王者荣耀 (1)
- session (2)
- token (5)
- cookie (4)
- springboot (24)
- jwt (2)
- 项目路径 (1)
- magicbook (1)
- requestType (1)
- json (2)
- swagger (1)
- eolinker (1)
- springdata (1)
- springmvc (1)
- controlleradvice (1)
- profile (1)
- 银行四要素 (1)
- 支付人员资源 (1)
- 支付渠道 (1)
- yaml (1)
- 中文编码 (1)
- mongo (2)
- serializable (1)
- 序列化 (1)
- zyd (1)
- unittest (1)
- 工具 (1)
- Something (1)
- 通达信 (1)
- protobuf (1)
- 算法 (1)
- springcloud (2)
- hikari (1)
- rocketmq (7)
- cachecloud (1)
- serfj (1)
- axure (1)
- lombok (1)
- 分布式锁 (1)
- 线程 (2)
- 同步代码块 (1)
- cobar (1)
- mq (1)
- rabbitmq (1)
- 定时执行 (1)
- 支付系统 (3)
- 唱歌 (1)
- elasticjob (1)
- 定时任务 (1)
- 界面 (1)
- flink (2)
- 大数据 (1)
- 接私活 (0)
- 内部培训 (2)
最新评论
-
dannyhz:
做股票从短线 试水,然后 慢慢发现 波段和 中期的故事可挖, ...
搭台唱戏 -
dannyhz:
http://developer.51cto.com/art/ ...
如何自己开发框架 它的注意点是什么
http://www.jb51.net/article/123012.htm
前言
本文主要给大家介绍了关于Spring4自定义@Value功能的相关内容,使用的Spring版本4.3.10.RELEASE,下面话不多说了,来一起看看详细的介绍吧。
@Value在Spring中,功能非常强大,可以注入一个配置项,可以引用容器中的Bean(调用其方法),也可以做一些简单的运算
如下的一个简单demo,演示@Value的用法
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import org.springframework.stereotype.Service;
/**
* 测试Bean
*/
@Service("userService")
public class UserService {
public int count() {
return 10;
}
public int max(int size) {
int count = count();
return count > size ? count : size;
}
}
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class AppRunner implements InitializingBean {
/**
* 引用一个配置项
*/
@Value("${app.port}")
private int port;
/**
* 调用容器的一个bean的方法获取值
*/
@Value("#{userService.count()}")
private int userCount;
/**
* 调用容器的一个bean的方法,且传入一个配置项的值作为参数
*/
@Value("#{userService.max(${app.size})}")
private int max;
/**
* 简单的运算
*/
@Value("#{${app.size} <= '12345'.length() ? ${app.size} : '12345'.length()}")
private int min;
//测试
public void afterPropertiesSet() throws Exception {
System.out.println("port : " + port);
System.out.println("userCount : " + userCount);
System.out.println("max : " + max);
System.out.println("min : " + min);
}
}
app.properties
?
1
2
3
app.port=9090
app.size=3
?
1
2
3
4
5
6
7
8
9
10
11
12
13
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@ComponentScan
@PropertySource("classpath:app.properties")
public class App {
public static void main( String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(App.class);
context.close();
}
}
运行,输出结果
port : 9090
userCount : 10
max : 10
min : 3
一般的用法就是这样,用于注入一个值。
那么,能否做到,我给定一个表达式或者具体的值,它能帮忙计算出表达式的值呢? 也就是说,实现一个@Value的功能呢?
方法如下:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import org.springframework.beans.factory.config.BeanExpressionContext;
import org.springframework.beans.factory.config.BeanExpressionResolver;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.expression.StandardBeanExpressionResolver;
public class ValueUtil {
private static final BeanExpressionResolver resolver = new StandardBeanExpressionResolver();
/**
* 解析一个表达式,获取一个值
* @param beanFactory
* @param value 一个固定值或一个表达式。如果是一个固定值,则直接返回固定值,否则解析一个表达式,返回解析后的值
* @return
*/
public static Object resolveExpression(ConfigurableBeanFactory beanFactory, String value) {
String resolvedValue = beanFactory.resolveEmbeddedValue(value);
if (!(resolvedValue.startsWith("#{") && value.endsWith("}"))) {
return resolvedValue;
}
return resolver.evaluate(resolvedValue, new BeanExpressionContext(beanFactory, null));
}
}
具体使用如下:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@ComponentScan
@PropertySource("classpath:app.properties")
public class App {
public static void main( String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(App.class);
//计算一个具体的值(非表达式)
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "1121"));
//实现@Value的功能
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "${app.port}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{userService.count()}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{userService.max(${app.size})}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{${app.size} <= '12345'.length() ? ${app.size} : '12345'.length()}"));
context.close();
}
}
运行输出如下:
1121
9090
10
10
3
发现已经实现了@Value的功能
最后,可能有人就有疑问了,这有什么用呢?我直接用@Value难道不好吗?
对于大部分场景下,的确直接用@Value就可以了。但是,有些特殊的场景,@Value做不了
比如说,我们定义一个注解
?
1
2
3
4
5
@Retention(RUNTIME)
@Target(TYPE)
public @interface Job {
String cron();
}
这个注解需要一个cron的表达式,我们的需求是,使用方可以直接用一个cron表达式,也可以支持引用一个配置项(把值配置到配置文件中)
比如说
?
1
2
@Job(cron = "0 0 12 * * ?")
@Job(cron = "${app.job.cron}")
这种情况@Value就做不到,但是,可以用我上面的解决方案。
引用
前言
本文主要给大家介绍了关于Spring4自定义@Value功能的相关内容,使用的Spring版本4.3.10.RELEASE,下面话不多说了,来一起看看详细的介绍吧。
@Value在Spring中,功能非常强大,可以注入一个配置项,可以引用容器中的Bean(调用其方法),也可以做一些简单的运算
如下的一个简单demo,演示@Value的用法
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import org.springframework.stereotype.Service;
/**
* 测试Bean
*/
@Service("userService")
public class UserService {
public int count() {
return 10;
}
public int max(int size) {
int count = count();
return count > size ? count : size;
}
}
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class AppRunner implements InitializingBean {
/**
* 引用一个配置项
*/
@Value("${app.port}")
private int port;
/**
* 调用容器的一个bean的方法获取值
*/
@Value("#{userService.count()}")
private int userCount;
/**
* 调用容器的一个bean的方法,且传入一个配置项的值作为参数
*/
@Value("#{userService.max(${app.size})}")
private int max;
/**
* 简单的运算
*/
@Value("#{${app.size} <= '12345'.length() ? ${app.size} : '12345'.length()}")
private int min;
//测试
public void afterPropertiesSet() throws Exception {
System.out.println("port : " + port);
System.out.println("userCount : " + userCount);
System.out.println("max : " + max);
System.out.println("min : " + min);
}
}
app.properties
?
1
2
3
app.port=9090
app.size=3
?
1
2
3
4
5
6
7
8
9
10
11
12
13
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@ComponentScan
@PropertySource("classpath:app.properties")
public class App {
public static void main( String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(App.class);
context.close();
}
}
运行,输出结果
port : 9090
userCount : 10
max : 10
min : 3
一般的用法就是这样,用于注入一个值。
那么,能否做到,我给定一个表达式或者具体的值,它能帮忙计算出表达式的值呢? 也就是说,实现一个@Value的功能呢?
方法如下:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import org.springframework.beans.factory.config.BeanExpressionContext;
import org.springframework.beans.factory.config.BeanExpressionResolver;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.expression.StandardBeanExpressionResolver;
public class ValueUtil {
private static final BeanExpressionResolver resolver = new StandardBeanExpressionResolver();
/**
* 解析一个表达式,获取一个值
* @param beanFactory
* @param value 一个固定值或一个表达式。如果是一个固定值,则直接返回固定值,否则解析一个表达式,返回解析后的值
* @return
*/
public static Object resolveExpression(ConfigurableBeanFactory beanFactory, String value) {
String resolvedValue = beanFactory.resolveEmbeddedValue(value);
if (!(resolvedValue.startsWith("#{") && value.endsWith("}"))) {
return resolvedValue;
}
return resolver.evaluate(resolvedValue, new BeanExpressionContext(beanFactory, null));
}
}
具体使用如下:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@ComponentScan
@PropertySource("classpath:app.properties")
public class App {
public static void main( String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(App.class);
//计算一个具体的值(非表达式)
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "1121"));
//实现@Value的功能
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "${app.port}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{userService.count()}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{userService.max(${app.size})}"));
System.out.println(ValueUtil.resolveExpression(context.getBeanFactory(), "#{${app.size} <= '12345'.length() ? ${app.size} : '12345'.length()}"));
context.close();
}
}
运行输出如下:
1121
9090
10
10
3
发现已经实现了@Value的功能
最后,可能有人就有疑问了,这有什么用呢?我直接用@Value难道不好吗?
对于大部分场景下,的确直接用@Value就可以了。但是,有些特殊的场景,@Value做不了
比如说,我们定义一个注解
?
1
2
3
4
5
@Retention(RUNTIME)
@Target(TYPE)
public @interface Job {
String cron();
}
这个注解需要一个cron的表达式,我们的需求是,使用方可以直接用一个cron表达式,也可以支持引用一个配置项(把值配置到配置文件中)
比如说
?
1
2
@Job(cron = "0 0 12 * * ?")
@Job(cron = "${app.job.cron}")
这种情况@Value就做不到,但是,可以用我上面的解决方案。
发表评论
-
spring mvc的工作原理 有图很清晰
2018-09-29 11:01 356引用 https://www.cnblogs.com/xiao ... -
spring property loader的 placeholder的详细分析
2018-09-29 10:59 368引用 https://blog.csdn.net/liuxin ... -
对于spring controller的详细分析和使用指导
2018-09-29 10:58 363引用 https://www.cnblogs.com/lcs- ... -
简单servlet spring 已经mvc controller
2018-09-28 20:42 300引用 https://blog.csdn.net/liuxin ... -
@value 的详解
2018-08-23 19:07 392引用 http://www.cnblogs.com/kings ... -
spring mvc ,spring boot里面的关于 global exception handle , controller advice的解释
2018-07-18 12:43 546引用 https://blog.csdn.net/kingin ... -
关于spring 的json的传递 yixiaoping
2018-06-29 22:01 227https://blog.csdn.net/**/articl ... -
github 下载具体版本的 spring
2018-06-06 22:02 348引用https://blog.csdn.net/bbc2005 ... -
tomcat 到 servlet 到 spring servlet dispatcher的一串
2018-05-30 21:57 560引用 五月 30, 2018 9:31:35 下午 org. ... -
前三句可以打印 mybatis log
2018-03-25 21:46 431引用 @Test public void test( ... -
spring整合 quartz
2018-03-06 22:07 306http://blog.csdn.net/YangRunkan ... -
spring 配置文件的安排 包括linux和windows和本地
2018-02-01 14:35 483引用 <bean id="propertyC ... -
批量插入数据
2018-01-04 20:57 351https://www.cnblogs.com/LiQ0116 ... -
MyBatis-Spring整合 注入SqlSessionTemplate
2018-01-04 20:41 656http://blog.csdn.net/qq_3965444 ... -
spring标签 @Resource 出错的track
2017-12-27 15:19 384引用 org.springframework.beans ... -
spring中何时用resource 和 service
2017-12-26 20:44 436引用 Spring中什么时候用@Resource,什么时候用 ... -
Spring 配置多数据源实现数据库读写分离
2017-12-26 20:34 350http://uule.iteye.com/blog/2126 ... -
基于注解的Spring多数据源配置和使用
2017-12-24 18:39 428https://www.cnblogs.com/liujidu ... -
lixiang 关于socket的spring例子
2017-12-04 16:21 310https://github.com/spring-proje ... -
比较这两个方式 在web程序跑和junit时候 显示的内容 是不一样的
2017-12-01 11:16 403C:\danny\code_base\20171031 ...
相关推荐
并定义了一个 org.springframework.aop.framework.ProxyFactoryBean对象(messageSender),FactoryBean或ApplicationContext将使用ProxyFactoryBean来建立代理对象,在这里就是messageSenderImpl建立代理对象。...
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <!-- apache.dbcp连接池的配置 --> ...
4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics II. Getting Started 8. Introducing Spring Boot 9. System Requirements 9.1. Servlet ...
在Spring3中配置数据源,包括DBCP,C3P0,Proxool,Bonecp主要的数据源,里面包含这些数据源的jar文件和依赖文件及配置文件。。 如Bonecp目前听说是最快的数据源,速度是传统的c3p0的25倍, bonecp.properties文件: ...
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" /> ...
<display-name>Spring Annotation MVC Sample <!-- Spring 服务层的配置文件 --> <param-name>contextConfigLocation <param-value>classpath:applicationContext.xml</param-value> <!-- Spring 容器...
org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,accountBiz,dataSource,sqlSessionFactory,...
spring3.2+strut2+hibernate4 注解方式。 spring.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=...
弃用了struts,用spring mvc框架做了几个项目,感觉都不错,而且使用了注解方式,可以省掉一大堆配置文件。本文主要介绍使用注解方式配置的spring mvc,之前写的spring3.0 mvc和rest小例子没有介绍到数据层的内容,...
使用@SpringBootApplication Annotation 19.运行您的应用程序 19.1.从IDE运行 19.2.作为打包应用程序运行 19.3.使用Maven插件 19.4.使用Gradle插件 19.5.热插拔 20.开发人员工具 20.1....
<value>jxg/Qr4VbxU=</value> <!-- password --> <value>jxg/Qr4VbxU=</value> <!-- 生产环境模式 ,才特殊处理加密密码--> <value>true</value> <!-- ptc windchill的數據庫 --> ...
注解包含: 拦截器 , 过滤器 , 序列化 , @After , @AfterReturning , @AfterThrowing , @annotation , @Around , @Aspect , @Autowired , @Bean , @Before , @Component , @ComponentScan , @ComponentScans , @...
New Features ...spring-jcl routes logging inefficiently against SLF4J with log4j-to-slf4j setup [SPR-17586] #22118 Allow java.time types for setting the Last-Modified header [SPR-17571] #22103 ...
其实还有更简单的方法,而且是更好的方法,使用合理描述参数和SQL语句返回值的接口(比如IUserOperation.class),这样现在就可以至此那个更简单,更安全的代码,没有容易发生的字符串文字和转换的错误.下面是详细...
<bean class ="org.springframework.beans.factory.annotation. AutowiredAnnotationBeanPostProcessor"/> <!-- 移除 boss Bean 的属性注入配置的信息 --> ...
是英文版本的哦,建议有耐心的读者下载. Available Pages · Documentation · Annotations · After Annotation · AnnotationWorkflowInterceptor · Before Annotation · BeforeResult ...· XWork Value Stack
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <value> org.whvcse.model.Userinfo ...
import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean; ...