When many data items are input in the form, an exception occurs when the controller is submitted and the data is displayed.

Source: Internet
Author: User

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 );

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.