• ZolltyMVC配置-说明文档


    目前XML里支持的一级元素如下:

         <!-- 配置 -->
         <xsd:element ref="mvc"/>
         <xsd:element ref="logger"/>
         <xsd:element ref="errorPage"/>
         <xsd:element ref="no-intercept"/>
         <xsd:element ref="component-scan"/>
         <!-- 基础 -->
         <xsd:element ref="bean"/>
         <xsd:element ref="import"/>

    1、mvc元素

    如果不设置此元素,那么默认的配置为:

    <mvc view-path="/WEB-INF/pages" view-encoding="UTF-8" />

    如果设置多个mvc元素,将以第一个为准,后面的将被忽略。

    2、logger元素

    如果不设置此元素,那么默认的配置为:

    <logger class="ConsoleLogger" level="DEBUG" />

    如果设置多个logger元素,将以第一个为准,后面的将被忽略。

    3、errorPage元素

    可以不设置此元素,那么默认用ZolltyMVC自己提供的错误处理页面,风格如下:

    如果设置多个errorPage元素,将以第一个为准,后面的将被忽略。

    4、no-intercept元素

    可以不设置此元素。

    如果设置多个no-intercept元素,将会把它们所有相同的属性叠加,也就是说全部设置的排除拦截匹配都会起作用。

    5、component-scan元素

    可以不设置此元素。

    如果设置多个component-scan元素,将会把它们所有相同的属性叠加,也就是说全部设置的包都会被扫描。

    6、import元素

    可以不设置此元素。

    如果设置多个import元素,将会把它们所有相同的属性叠加,也就是说全部import的文件都会起效。

    7、bean元素

     这个就不用说了吧,你懂的。

    以“mvc”元素为例,其定义为:

       <xsd:complexType name="mvcType">
            <xsd:attribute name="view-path" type="xsd:string" use="required">
            </xsd:attribute>
            <xsd:attribute name="view-encoding" type="xsd:string" use="required">
            </xsd:attribute>
        </xsd:complexType>

    也就是说,它有两个属性:view-path和view-encoding,而且都是必须的(use="required")

    同理,其他的配置如下:(具体可参见zollty-mvc.xsd)

        <xsd:complexType name="mvcType">
            <xsd:attribute name="view-path" type="xsd:string" use="required">
            </xsd:attribute>
            <xsd:attribute name="view-encoding" type="xsd:string" use="required">
            </xsd:attribute>
        </xsd:complexType>
        
        <xsd:complexType name="componentScanType">
            <xsd:attribute name="base-package" type="xsd:string" use="required">
            </xsd:attribute>
        </xsd:complexType>
        
        <xsd:complexType name="loggerType">
            <xsd:attribute name="class" type="xsd:string" use="required">
            </xsd:attribute>
            <xsd:attribute name="level" type="xsd:string">
            </xsd:attribute>
        </xsd:complexType>
        
        <xsd:complexType name="noInterceptType">
            <xsd:attribute name="prefix" type="xsd:string">
            </xsd:attribute>
            <xsd:attribute name="suffix" type="xsd:string">
            </xsd:attribute>
        </xsd:complexType>
        
        <xsd:complexType name="errorPageType">
            <xsd:attribute name="path" type="xsd:string" use="required">
            </xsd:attribute>
        </xsd:complexType>
        
        <xsd:complexType name="importType">
            <xsd:attribute name="resource" type="xsd:string" use="required">
            </xsd:attribute>
        </xsd:complexType>
  • 相关阅读:
    百度搜索时加上 (要屏蔽的内容),你会回来感谢我的。
    layui中不全的组件
    PHP使用gd库做的图像处理
    范用户体验相关BLOG
    视频聊天室软件的技术标准
    QTP11使用DOM XPath以及CSS识别元素对象
    跟我一起学Oracle 11g【11】Oracle 中的事务
    一点关于 mybatis 的记录
    git撤销本地commit,复原本地代码与服务器同步
    中国人民银行令〔2021〕第4号(征信业务管理办法)
  • 原文地址:https://www.cnblogs.com/zollty/p/3450164.html
Copyright © 2020-2023  润新知