1.BeanUtils工具类
1.使用
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
Emp emp = new Emp();
Map<String, String[]> parameterMap = req.getParameterMap();
try {
BeanUtils.populate(emp,parameterMap);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
2.HuTool的工具类
1.使用
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.13</version>
<scope>compile</sco