1. Required JAR Package:
Itcast-tools-1.4.jar http://pan.baidu.com/s/1Dbo2i
Commons-beanutils-1.8.3.jar http://pan.baidu.com/s/1Dbo2i
Commons-logging-1.1.1.jar http://pan.baidu.com/s/1c0yefK0
2. Map data Create JavaBean objects of any class T tobean (map, class<t>) : Put map Convert to of the specified type bean object. Typically used to get form data ( request.getparametermap () javabean common-beanutils map Span style= "FONT-FAMILY:CALIBRI;" >bean
Entities that require Person.java.
Key code Examples:
map<string,object> map = new hashmap<string,object> ();//Create Map
Map.put ("pid", "123");
Map.put ("PName", "Zhang San");
Map.put ("Age", "23");
The person field has PID, pname, age
Person p = Commonutils.tobean (map,person.class);//Use map data to create a JavaBean object of type "P" is a man object
Note: 1. As long as the key value is the same;
2. If there is a map and the person field is not, do not map to related fields
3. If there is a person, and none in map, the person corresponding field is null (string type, int is generally 0)
Map data to create JavaBean objects of any class