Spring 给Bean属性注入null值
2016-06-06 14:40
387 查看
空字符串值可以使用
等同于Java代码:
null值则可以使用
等同于Java代码:
<value/>元素可用来表示。例如:
<bean class="ExampleBean"> <property name="email"><value/></property> </bean>
等同于Java代码:
exampleBean.setEmail("")。
null值则可以使用
<null/>元素可用来表示。例如:
<bean class="ExampleBean"> <property name="email"><null/></property> </bean>
等同于Java代码:
exampleBean.setEmail(null)。
相关文章推荐
- pojo和javabean的比较
- 在eclipse如何删除无效的maven build
- Java是如何管理内存
- 2、spring_ioc
- springmvc
- Ubuntu 16.04 火狐添加java插件、解决Firefox强制低版本java插件运行以及安全设置限制自签名应用程序运行
- Spring Boot的Profile切换方式
- 用spring的InitializingBean的afterPropertiesSet来初始化
- 栈与堆的区别
- Spring AOP时的问题
- [LeetCode][6]ZigZag Conversion解析与特殊解法 -Java实现
- Spring AOP 学习(一) 代理模式
- Java泛型
- java中Scanner的hasNext()的疑问
- Java配置文件读取和路径设置
- 从网页上考的代码考到eclipse里面,会出现每行开头的空格下面有红色异常提示,为什么?
- spring mvc中jsp不能访问的原因
- JAVA集合中的迭代器的遍历
- java线程安全总结
- spring4+springmvc+mybatis