点击访问 Common BeanUtils 官网链接

点击访问 Common Logging 官网链接

点击查看使用 BeanUtils获取Request的请求参数

BeanUtils是由Apache公司开发的针对操作JavaBean的工具包。对于JavaBean,简单的来说,就是要有一个空参的构造器和对属性的getXXX方法和setXXX方法。在由JDK提供的默认的API中,有java.beans包,里面有诸如Introspector,BeanInfo,PropertyDescriptor等用来操作JavaBean的方法,但是由Apache公司开发的BeanUtils会更常用,同时,BeanUtils还需要配合第三方日志工具来使用,这里我们同样使用Apache公司的common logging,

注意:Common BeanUtils需配合Common Logging,而不是Log4j,当然Log4j也是Apache公司的,可以下载以备以后使用。

1、下载【Common BeanUtils】和【Commons-Logging】压缩包(点击上方的官网链接可以直接访问下载):

获取以及配置Common BeanUtils 和 Commons-Logging jar包_官网获取以及配置Common BeanUtils 和 Commons-Logging jar包_其他_02

2、解压zip压缩文件,将里面的Common BeanUtils 和 Commons-Logging jar包拷出来,方便使用

获取以及配置Common BeanUtils 和 Commons-Logging jar包_java_03

获取以及配置Common BeanUtils 和 Commons-Logging jar包_apache_04

3、将两者的 jar 包直接拷入到项目文件的【lib】文件夹下

获取以及配置Common BeanUtils 和 Commons-Logging jar包_其他_05

4、(很重要)同时选中lib文件夹的这两个包,右键选择【Build】,再选择【Add to Build Path】,将这两个包导入到构建路径中去:

获取以及配置Common BeanUtils 和 Commons-Logging jar包_apache_06

获取以及配置Common BeanUtils 和 Commons-Logging jar包_官网_07