Closed sandwich99 closed 10 years ago
public class User{ private String name; private String age; private Address address; setter ..getter } public class Address{ private Long id; private String location; private String street; private String houseNumber; private String otherAttr; } public class UserVO{ private String name; private String age; private String street; private String location; private String houseNumber; }
业务场景:
User 表有 address 属性,类型为Address 前台使用REST接口输出数据,需要把Address中的一个或多个数据向上作为UserVO的属性传递到前台表格展现。
使用EL表达式功能
比如:field-mapping targetName="street" script="src.address.street" 将左边address.street的属性,复制到右边的street属性
业务场景:
User 表有 address 属性,类型为Address 前台使用REST接口输出数据,需要把Address中的一个或多个数据向上作为UserVO的属性传递到前台表格展现。