struts2处理json

本文介绍Struts2框架中JSON插件的使用方法,包括如何指定输出字段、过滤空值、控制继承关系等高级配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

46人阅读 评论(0) 收藏 举报
5.1. root参数:从归回结果中根据ognl表达式掏出你需要输出的结果<wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  如:</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  action类</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class BaseAction extends ActionSupport implements</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  {</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private Person person = null;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  }</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class BaseAction extends ActionSupport implements {private Person person = null;...}</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  bean类</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  1</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class Person</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  {</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private String name;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private int age;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  }</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class Person {private String name;private int age;...}</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  我们只要输出person对象的name属性值,配置如次</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  1</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><img title="struts2处理json" alt="struts2处理json" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" style="text-align:left; padding-bottom:0px; line-height:21px; border-right-width:0px; list-style-type:none; margin:0px; padding-left:0px; padding-right:0px; font-family:tahoma,arial,宋体,sans-serif; border-top-width:0px; border-bottom-width:0px; color:rgb(51,51,51); font-size:14px; border-left-width:0px; padding-top:0px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="root"&gt;person.name&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="root"&gt;person.name&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.2. excludeNullProperties 参数:表示是不是去掉空值, 默认值是false,如果设置为true会自动将为空的值过滤,只输出不为空的值。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="excludeNullProperties"&gt;true&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="excludeNullProperties"&gt;true&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">   5.3. ignoreHierarchy 参数:表示是不是纰漏等级,也就是继承关系,好比:TestAction继承于BaseAction,那么TestAction中归回的json字符串默 认是不会包含父类BaseAction的属性值,ignoreHierarchy值默认为true,设置为false后会将父类以及子类的属性一起归回。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="ignoreHierarchy"&gt;false&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="ignoreHierarchy"&gt;false&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.4. includeProperties 参数:输出结果中需要包含的属性值,这搭正则表达式以及属性名匹配,可以用“,”分割填充多个正则表达式。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  如:输出person的所有属性</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="includeProperties"&gt;person.*, person\.name&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="includeProperties"&gt;person.*, person\.name&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.5. excludeProperties 参数:输出结果需要剔掉的属性值,也支持正则表达式匹配属性名,可以用“,”分割填充多个正则表达式,大致相同4.4.</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
5.1. root参数:从归回结果中根据ognl表达式掏出你需要输出的结果<wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  如:</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  action类</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class BaseAction extends ActionSupport implements</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  {</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private Person person = null;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  }</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class BaseAction extends ActionSupport implements {private Person person = null;...}</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  bean类</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  1</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class Person</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  {</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private String name;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  private int age;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  }</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  public class Person {private String name;private int age;...}</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  我们只要输出person对象的name属性值,配置如次</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  1</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><img title="struts2处理json" alt="struts2处理json" src="http://www.blogjava.net/Images/OutliningIndicators/None.gif" style="text-align:left; padding-bottom:0px; line-height:21px; border-right-width:0px; list-style-type:none; margin:0px; padding-left:0px; padding-right:0px; font-family:tahoma,arial,宋体,sans-serif; border-top-width:0px; border-bottom-width:0px; color:rgb(51,51,51); font-size:14px; border-left-width:0px; padding-top:0px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="root"&gt;person.name&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="root"&gt;person.name&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.2. excludeNullProperties 参数:表示是不是去掉空值, 默认值是false,如果设置为true会自动将为空的值过滤,只输出不为空的值。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="excludeNullProperties"&gt;true&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="excludeNullProperties"&gt;true&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">   5.3. ignoreHierarchy 参数:表示是不是纰漏等级,也就是继承关系,好比:TestAction继承于BaseAction,那么TestAction中归回的json字符串默 认是不会包含父类BaseAction的属性值,ignoreHierarchy值默认为true,设置为false后会将父类以及子类的属性一起归回。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="ignoreHierarchy"&gt;false&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="ignoreHierarchy"&gt;false&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.4. includeProperties 参数:输出结果中需要包含的属性值,这搭正则表达式以及属性名匹配,可以用“,”分割填充多个正则表达式。</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  如:输出person的所有属性</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;param name="includeProperties"&gt;person.*, person\.name&lt;/param&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px"> </span><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  &lt;result type="json"&gt;&lt;param name="includeProperties"&gt;person.*, person\.name&lt;/param&gt;&lt;/result&gt;</span><wbr style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><br style="text-align:left; line-height:21px; font-family:tahoma,arial,宋体,sans-serif; color:rgb(51,51,51); font-size:14px"><span style="font-family:tahoma,arial,宋体,sans-serif; color:#333333; text-align:left; line-height:21px; font-size:14px">  5.5. excludeProperties 参数:输出结果需要剔掉的属性值,也支持正则表达式匹配属性名,可以用“,”分割填充多个正则表达式,大致相同4.4.</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值