struts json result 指定需要序列化的属性
来源:互联网 发布:手机称重量软件 编辑:程序博客网 时间:2024/06/01 09:35
官方地址: http://struts.apache.org/2.2.3/docs/json-plugin.html
设置哪些属性要序列化哪些不需要序列化;
Customizing Serialization and Deserialization
Use the JSON annotation to customize the serialization/deserialization process. Available JSON annotation fields:
Excluding properties
A comma-delimited list of regular expressions can be passed to the JSON Result and Interceptor, properties matching any of these regular expressions will be ignored on the serialization process:
<!-- Result fragment --><result type="json"> <param name="excludeProperties"> login.password, studentList.*\.sin </param></result><!-- Interceptor fragment --><interceptor-ref name="json"> <param name="enableSMD">true</param> <param name="excludeProperties"> login.password, studentList.*\.sin </param></interceptor-ref>
Including properties
A comma-delimited list of regular expressions can be passed to the JSON Result to restrict which properties will be serialized. ONLY properties matching any of these regular expressions will be included in the serialized output.
Exclude property expressions take precedence over include property expressions. That is, if you use include and exclude property expressions on the same result, include property expressions will not be applied if an exclude exclude property expression matches a property first.
<!-- Result fragment --><result type="json"> <param name="includeProperties"> ^entries\[\d+\]\.clientNumber, ^entries\[\d+\]\.scheduleNumber, ^entries\[\d+\]\.createUserId </param></result>
- struts json result 指定需要序列化的属性
- struts的result标签的type属性
- struts配置的result属性。 result的动态配置 . result 全局结果 global-result
- ASP.NET中Json序列化指定对象的部分属性值
- JSON中result的root属性
- 动态结果配置:struts.xml中,<result>属性的type配置之redirectAction(请求重定向到指定的Action)
- struts2之使用JSON插件实现Ajax(在struts.xml中处理要序列化的属性)
- struts json插件json属性的认识
- struts.xml文件中<result>的type属性详解
- struts2 struts.xml result type 属性的说明
- struts.xml中的Result标签的type属性
- Struts学习之result的type属性详解+案例
- struts使用json需要加入的包
- struts 2 的Result
- struts 2 的Result
- list中按照指定属性的值序列化
- JSON 自定义序列化(过滤掉不想要的属性)
- struts框架中struts.xml中action标签中result标签的两个常用属性
- Perl 注释
- dom例子八(开关灯-文本框-评分控件)
- (百例编程)63.减式还原
- 云存储概要介绍
- android关于动态壁纸live WallPaper
- struts json result 指定需要序列化的属性
- Information Gain 计算 python实现
- mapreduce的shuffle和排序
- (百题编程)64.乘式还原
- 网游服务器通信架构的设计
- 二叉树——高度
- dom例子九(加载网址到表格-简易无刷新评论)
- (百例编程)65.乘式还原(2)
- Spring ApplicationContext.xml配置的12个技巧