BeanUtils.populate的作用
来源:互联网 发布:707的医药软件 编辑:程序博客网 时间:2024/05/22 09:40
首先,它是在org.apache.commons.beanutils.BeanUtils包中的一个方法。
方法的作用:用来将一些 key-value 的值(例如 hashmap)映射到 bean 中的属性。
servlet中有这样的使用:
先定义form表单内容的Info对象(当然你要先写一个bean,这个bean中包含form表单中各个对象的属性)
InsuranceInfo info = new InsuranceInfo(); (这是一个javabean)
——>BeanUtils.populate(info, propertyMap);(调用包中方法映射)
映射的过程就是将页面中的内容先用request获得,然后再将之转换为Map(这里用request.getParameterMap())
方法的作用:用来将一些 key-value 的值(例如 hashmap)映射到 bean 中的属性。
servlet中有这样的使用:
先定义form表单内容的Info对象(当然你要先写一个bean,这个bean中包含form表单中各个对象的属性)
InsuranceInfo info = new InsuranceInfo(); (这是一个javabean)
BeanUtilities.populateBean(info, request);
——>BeanUtils.populate(info, propertyMap);(调用包中方法映射)
映射的过程就是将页面中的内容先用request获得,然后再将之转换为Map(这里用request.getParameterMap())
最后使用BeanUtils.populate(info,map)方法将页面各个属性映射到bean中。之后我们就可以这样使用bean.getXxxx()来取值了。
出处:http://blog.sina.com.cn/s/blog_84f5d20b0100tyuw.html
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用 !
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate的作用
- BeanUtils.populate(obj,map)的作用
- BeanUtils.populate的作用-注册页面
- BeanUtils.populate的用法
- BeanUtils.populate的用法
- 解决 BeanUtils.populate 的问题
- 关于BeanUtils.populate的解决
- BeanUtils.populate
- BeanUtils.populate
- java基础常识
- 实数和字符在计算机中的存储方式
- Yaffs2 文件系统移植
- andoid x项目的优化 1
- Android系统自带样式(android:theme)(转)
- BeanUtils.populate的作用
- linux rhel /usr/src/kernels 目录下没有系统内核源码--解决方法
- C++内存管理学习
- 笔试面试集合
- 粗略比对一下windows、linux和OS。算是个人体会和感想吧
- hdu 1026 Ignatius and the Princess I
- eclipse Fail to load the JNI share library"C:\Java\jdk1.7.0\bin\..\jre\bin\client\jvm.dll
- Android新开一个activity需要配置文件AndroidManifest.xml
- 使用Google Unit Test 测试你的C++代码