1. Added (Model passes form data)
Request. getsession (). setattribute ("car", car); // data echo when an exception is thrown.
2. Modification (Model transfers form data)
Car car2 = carservice. detailall (car. getregno (); try {beanutils. copyproperties (car2, car);} catch (illegalaccessexception e) {EC = errorcode. sys_error; logger. error ("system error! ", E);} catch (invocationtargetexception e) {EC = errorcode. sys_error; logger. Error (" system error! ", E);} // convert the old and new values to request. setattribute (" car ", car2 );
Beanutils. copyproperties (car2, car );
3. Modification (MAP transmits form data)
Map <string, Object> map = carservice. detail (integer. valueof (carno); map. putall (data); // If the query result is the same as the new value data and the key value, it is replaced by data. Request. setattribute ("car", MAP );