• <menu id="eeoky"><tt id="eeoky"></tt></menu>
  • <nav id="eeoky"></nav>
  • Tomca教程
    Tomcat Manager
    Tomcat Realm 配置
    Tomcat 安全管理
    Tomcat JNDI 資源
    Tomcat JDBC 數據源
    Tomcat 類加載機制
    Tomcat JSPs
    Tomcat SSL/TLS配置
    Tomcat SSI
    Tomcat CGI
    Tomcat 代理支持
    Tomcat MBean 描述符
    Tomcat 默認 Servlet
    Tomcat 集群
    Tomcat 連接器
    Tomcat監控與管理
    Tomcat 日志機制
    Tomcat 基于 APR 的原生庫
    Tomcat 虛擬主機
    Tomcat 高級 IO 機制
    Tomcat 附加組件
    Tomcat 安全性注意事項
    Tomcat Windows 服務
    Tomcat Windows 認證
    Tomcat 的 JDBC 連接池
    Tomcat WebSocket 支持
    Tomcat 重寫機制

    任務輸出捕獲

    使用 Ant 1.6.2 版或更新版本,Catalina 任務提供選項,利用屬性或外部文件捕獲輸出。它們直接支持  類型屬性的子集:

    屬性

    屬性說明

    是否必需

    output

    輸出文件名。如果錯誤流沒有重定向到一個文件或屬性上,它將出現在輸出中。

    error

    命令的標準錯誤應該被重定向到的文件。

    logError

    用于在 Ant 日志中顯示錯誤輸出,將輸出重定向至某個文件或屬性。錯誤輸出不會包含在輸出文件或屬性中。如果利用 error 或 errorProperty 屬性重定向錯誤,則沒有任何效果。

    append

    輸出和錯誤文件是否應該附加或覆蓋。默認為 false。

    createemptyfiles

    是否應該創建輸出和錯誤文件,哪怕是空的文件。默認為 true。

    outputproperty

    用于保存命令輸出的屬性名。除非錯誤流被重定向至單獨的文件或流,否則這一屬性將包含錯誤輸出。

    errorproperty

    用于保存命令標準錯誤的屬性名。

    還可以指定其他一些額外屬性:

    屬性

    屬性說明

    是否必需

    alwaysLog

    該屬性用于查看捕獲的輸出,這個輸出也出現在 Ant 日志中。除非捕獲任務輸出,否則千萬不要使用它。默認為 false。Ant 1.6.3 通過  直接支持該屬性。

    failonerror

    用于避免因為 manager 命令處理中錯誤而導致 Ant 執行終止情況的發生。默認為 true。如果希望捕獲錯誤輸出,則必須設為false,否則 Ant 執行將有可能在未捕獲任何輸出前就被終止。該屬性只用于 manager 命令的執行上,任何錯誤的或丟失的命令屬性仍然會導致 Ant 執行終止。

    它們還支持內嵌的  元素,你可以在這些元素中指定全套的屬性。但對于input、inputstring、inputencoding,即使接收,也無法使用,因為在這種上下文中它們沒有任何意義。詳情可參考 Ant 手冊以了解  元素的各個屬性。

    下面這個范例摘錄了一段構建文件,展示了這種對輸出重定向的支持是如何運作的。

     <target name="manager.deploy"
            depends="context.status"
            if="context.notInstalled">
            <deploy url="${mgr.url}"
                username="${mgr.username}"
                password="${mgr.password}"
                path="${mgr.context.path}"
                config="${mgr.context.descriptor}"/>
        </target>
    
        <target name="manager.deploy.war"
            depends="context.status"
            if="context.deployable">
            <deploy url="${mgr.url}"
                username="${mgr.username}"
                password="${mgr.password}"
                update="${mgr.update}"
                path="${mgr.context.path}"
                war="${mgr.war.file}"/>
        </target>
    
        <target name="context.status">
            <property name="running" value="${mgr.context.path}:running"/>
            <property name="stopped" value="${mgr.context.path}:stopped"/>
    
            <list url="${mgr.url}"
                outputproperty="ctx.status"
                username="${mgr.username}"
                password="${mgr.password}">
            </list>
    
            <condition property="context.running">
                <contains string="${ctx.status}" substring="${running}"/>
            </condition>
            <condition property="context.stopped">
                <contains string="${ctx.status}" substring="${stopped}"/>
            </condition>
            <condition property="context.notInstalled">
                <and>
                    <isfalse value="${context.running}"/>
                    <isfalse value="${context.stopped}"/>
                </and>
            </condition>
            <condition property="context.deployable">
                <or>
                    <istrue value="${context.notInstalled}"/>
                    <and>
                        <istrue value="${context.running}"/>
                        <istrue value="${mgr.update}"/>
                    </and>
                    <and>
                        <istrue value="${context.stopped}"/>
                        <istrue value="${mgr.update}"/>
                    </and>
                </or>
            </condition>
            <condition property="context.undeployable">
                <or>
                    <istrue value="${context.running}"/>
                    <istrue value="${context.stopped}"/>
                </or>
            </condition>
        </target>

    警告:多次調用 Catalina 任務往往并不是一個好主意,退一步說這樣做的意義也不是很大。如果 Ant 任務依賴鏈設定糟糕的話,即使本意并非如此,也會導致在一次 Ant 運行中多次運行任務。必須提前對你稍加警告,因為有可能當你從任務中捕獲輸出時,會出現一些意想不到的情況:

    • 當用屬性捕獲時,你將只能從其中找到最初調用的輸出,因為 Ant 屬性是不變的,一旦設定就無法改變。
    • 當用文件捕獲時,你將只能從其中找到最后調用的輸出,除非使用 append = "true" 屬性——在這種情況下,你將看到附加在文件內容末尾的每一個任務調用的相關輸出。
    全部教程
    疯狂婬荡乱婬A片中文,特级西西人体444WWw高清大胆,国产性XXXX18免费观看视频,中文字幕乱伦,free性满足HD国产精品,牛人女厕偷拍1区2区