1. Student student = new Student();
    2. Map paramap = req.getParameterMap();
    3. //获取前端提交的数据
    4. try {
    5. BeanUtils.populate(student,paramap);
    6. }catch (IllegalAccessException e) {
    7. e.printStackTrace();
    8. }catch (InvocationTargetException e) {
    9. e.printStackTrace();
    10. }

    BeanUtils.populate方法可以将Map类型的键值,转入到bean中保存,这种方法或许可以传递中文,地址栏传递会乱码