Class1 f = sService.get(id); Class2 t = new Class2(); try { BeanUtils.copyProperties(t,f); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); }
//需要导commons-beanutils-1.8.3 包与 commons-logging-1.1.3 包