struts2 jsonplugin includeProperties 对list集合的正则配置

jsonplugin 0.32 0.34 官方下载 http://code.google.com/p/jsonplugin/

文档:http://code.google.com/p/jsonplugin/wiki/Documentation

https://cwiki.apache.org/confluence/display/WW/JSON%20Plugin

Excluding properties

Xml代码 复制代码 收藏代码
  1. <!-- Result fragment -->
  2. <resulttype="json">
  3. <paramname="excludeProperties">
  4. login.password,
  5. studentList.*\.sin
  6. </param>
  7. </result>
  8. <!-- Interceptor fragment -->
  9. <interceptor-refname="json">
  10. <paramname="enableSMD">true</param>
  11. <paramname="excludeProperties">
  12. login.password,
  13. studentList.*\.sin
  14. </param>
  15. </interceptor-ref>

Including properties

Xml代码 复制代码 收藏代码
  1. <!-- Result fragment -->
  2. <resulttype="json">
  3. <paramname="includeProperties">
  4. ^entries\[\d+\]\.clientNumber,
  5. ^entries\[\d+\]\.scheduleNumber,
  6. ^entries\[\d+\]\.createUserId
  7. </param>
  8. </result>

对集合 listAttachment.*, listAttachment\[\d+\] 含义是不同的

listAttachment.*, 指listAttachment集合对象本身

listAttachment\[\d+\] 指listAttachment集合对象中的元素

 

你可能感兴趣的:(struts2 jsonplugin includeProperties 对list集合的正则配置)