您的位置:首页 > Web前端 > JavaScript

json配置中的excludeNullProperties 参数的作用

2012-07-24 09:49 489 查看
excludeNullProperties 参数:表示是不是去掉空值, 默认值是false,如果设置为true会自动将为空的值过滤,只输出不为空的值。 

 
  <result type="json"> 
  
  <param name="excludeNullProperties">true</param> 
 
  </result> 
 
  <result type="json"><param name="excludeNullProperties">true</param></result> 
要是只想取出list对象集合中,对象的某几个属性,则需要下列配置:

<action
name="recommendList"
class="VideoAction"
method="recommendList">

<result
name="success"
type="json">

<param
name="includeProperties">recommendList\[\d+\]\.videoTime,recommendList\[\d+\]\.videoId,recommendList\[\d+\]\.videoImg,recommendList\[\d+\]\.videoTitle
</param>

</result>

</action>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  json