码迷,mamicode.com
首页 > 其他好文 > 详细

struts中的ignoreHierarchy 参数和root 参数

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

标签:style   strong   io   re   c   cti   

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 参数

标签:style   strong   io   re   c   cti   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!