zoukankan      html  css  js  c++  java
  • struts中的ignoreHierarchy 参数和root 参数

    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>
  • 相关阅读:
    关于 js 下载PDF文件时
    vue3.0 学习
    iOS
    bootstrap treeview
    SVN版本管理
    js框架
    正则表达式
    如何让安卓手机在电脑上同步显示(MX4 Pro为例)
    mysql 中文乱码
    ADO.NET 数据库连接池大小
  • 原文地址:https://www.cnblogs.com/tanglc/p/3862900.html
Copyright © 2011-2022 走看看