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>
<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>
相关文章推荐
- 关于hibernateProperties配置中hibernate.hbm2ddl.auto参数的作用
- Properties 配置文件参数 注入bean中
- 在类中获取jeeplus.properties配置文件中的参数
- 通过.properties文件配置参数
- 用一个随项目启动而初始化的servlet读取配置环境,参数的properties文件
- SpringMVC配置JSON接收参数字段多于后台字段
- 给你的JAVA程序配置参数(Properties的使用)
- 关于context:component-scan配置中use-default-filters参数的作用
- web.xml中配置contextConfigLocation参数作用
- apache kafka系列之server.properties配置文件参数说明
- server.properties中所有配置参数说明
- linux配置dhcp服务器时authoritative参数的作用
- struts2 jsonplugin includeProperties 对list集合的正则配置
- apache kafka中server.properties配置文件参数说明
- Springboot Web应用中服务器配置参数ServerProperties的加载
- angular-cli.json配置参数解释,以及依稀常用命令的通用关键参数解释
- linux配置dhcp服务器authoritative参数作用
- Spring mail 邮件服务及其参数配置(properties文件的读写)
- (3)配置微信服务器时接收的参数为null?
- Java关于Properties用法——替换配置文件中的参数