excludeNullProperties 参数:表示是不是去掉空值, 默认值是false,如果设置为true会自动将为空的值过滤,只输出不为空的值。
<result type="json">
<param name="excludeNullProperties">true</param>
</result>
<result type="json"><param name="excludeNullProperties">true</param></result>
<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>