首页 > 其他 > 详细

struts中的ignoreHierarchy 参数和root 参数

时间:2014-07-23 15:39:59      阅读:2193      评论:0      收藏:0      [点我收藏+]
struts2

 1.ignoreHierarchy 参数:表示是否忽略等级,也就是继承关系,比如:TestAction继承于BaseAction,那么TestAction中返回的json字符串默认是不会包含父类BaseAction .

2.root 参数用于指定要序列化的根对象,如果省去这一配置,表示要序列化 action 中的所有属性 ignoreHierarchy 为 false 时表示要序列化根对象的所有基类 excludeProperties .

---------------------------------------------------------------------------------------------------
  <global-results>
   <result name="error" type="dispatcher">
     /WEB-INF/jsp/error.jsp
   </result>
   <result name="rst" type="json">
    <param name="root">rst</param>
    <param name="contentType">text/html</param>
   </result>
   <result name="json" type="json">
    <param name="root">json</param>
   </result>
   <result name="extend" type="json">
    <param name="root">json</param>
    <param name="ignoreHierarchy">false</param> 
   </result>
  </global-results>

struts中的ignoreHierarchy 参数和root 参数,布布扣,bubuko.com

struts中的ignoreHierarchy 参数和root 参数

原文:http://www.cnblogs.com/tanglc/p/3862900.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!