1、引入:jackson-mapper-asl-1.9.2.jar2、导入:
import org.codehaus.jackson.map.annotate.JsonSerialize;import org.codehaus.jackson.map.ser.std.ToStringSerializer;3、在Long类型上添加注解
@JsonSerialize(using= ToStringSerializer.class)private Long id;