首页 新闻 赞助 找找看

控制台怎么取消打印web.xml内容

0
悬赏园豆:100 [已关闭问题] 关闭于 2018-01-11 13:55

问题:在控制台会打印项目中的web.xml内容和tomcat下的web.xml内容,想让web.xml不让打印出来,没找到解决办法,大家帮忙看下,感谢

控制台打印内容:

logback.xml

<?xml version="1.0" encoding="UTF-8"?>

<configuration debug="true">

    <!-- 控制台输出 -->
    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <!--格式化输出 -->
            <pattern>%date [%thread] %-5level %class.%method\(%line\) - %msg%n</pattern>
            <!-- <pattern>%date [%thread] %-5level %C{2}\(%L\) - %msg%n</pattern> -->
        </encoder>
    </appender>

    <!-- 根据不同的运行环境配置不同的日志策略 -->
    <if
        condition='"${spring.profiles.active}" == "devtest" || "${spring.profiles.active}" == "test" || "${spring.profiles.active}" == "production"'>
        <then>

            <if condition='"${spring.profiles.active}" == "devtest"'>
                <then>
                    <!-- 配置日志文件的保存地址 -->
                    <property name="file_path" value="/home/logs/operate" />
                </then>
            </if>
            <if condition='"${spring.profiles.active}" == "test"'>
                <then>
                    <property name="file_path" value="/data/weblog/operate" />
                </then>
            </if>
            <if condition='"${spring.profiles.active}" == "production"'>
                <then>
                    <property name="file_path" value="/data/soft/tomcat-operate2016/logs" />
                </then>
            </if>

            <!-- 每天生成日志文件 -->
            <appender name="debug_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
                <!--日志文件输出的文件名 -->
                <file>${file_path}/debug.log</file>
                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- daily rollover -->
                    <fileNamePattern>${file_path}/debug.%d{yyyy-MM-dd}.log</fileNamePattern>
                    <!--日志文件保留天数 -->
                    <maxHistory>365</maxHistory>
                </rollingPolicy>
                <encoder>
                    <pattern>%date [%thread] %-5level %class.%method\(%line\) - %msg%n</pattern>
                </encoder>
                <!--日志文件最大的大小 <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>10MB</MaxFileSize> 
                    </triggeringPolicy> -->
            </appender>
            <appender name="error_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
                <file>${file_path}/error.log</file>
                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <fileNamePattern>${file_path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
                    <maxHistory>365</maxHistory>
                </rollingPolicy>
                <encoder>
                    <pattern>%date [%thread] %-5level %class.%method\(%line\) - %msg%n</pattern>
                </encoder>
                <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
                    <level>error</level>
                </filter>
            </appender>



            <!-- 测试、线上环境的日志输出 -->
            <root level="debug">
                <!--<appender-ref ref="stdout" />-->
                <appender-ref ref="debug_file" />
                <appender-ref ref="error_file" />
                <appender-ref ref="email" />
            </root>

        </then>
        <else>

            <!-- 开发环境的日志输出 -->
            <root level="debug">
                <appender-ref ref="stdout" />
            </root>
        </else>
    </if>

    <logger name="com.opt" level="debug" />

    <logger name="org.mybatis" level="warn" />
    <!--<logger name="org.apache.ibatis" level="warn" /> -->
    <logger name="org.quartz.core" level="error" />
    <logger name="org.quartz.impl" level="error" />

</configuration>

struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
    <constant name="struts.ui.theme" value="simple" />
    <!-- 限制最大100MB -->
    <constant name="struts.multipart.maxSize" value="104857600" />
    <constant name="struts.multipart.saveDir" value="tmp" />

    <!-- action包路径在action下面 -->
    <constant name="struts.convention.package.locators" value="action" />
    <!-- action默认用的 package配置 -->
    <constant name="struts.convention.default.parent.package" value="crud-default" />

    <!-- 默认结果页面路径 <constant name="struts.convention.result.path" value="/WEB-INF/content" /> -->

    <!-- 用于 Action的parent package -->
    <package name="crud-default" extends="convention-default">

        <interceptors>
            <interceptor name="exceptionHandler" class="com.ucpaas.opt.action.interceptor.ExceptonHandlerInterceptor"></interceptor>
            <interceptor-stack name="ucpaasStack">
                <interceptor-ref name="defaultStack">
                    <!-- 解决exception-mapping后控制台无法打印异常信息问题 -->
                    <param name="exception.logEnabled">true</param>
                    <param name="exception.logLevel">error</param>
                </interceptor-ref>
            </interceptor-stack>
        </interceptors>
        <default-interceptor-ref name="ucpaasStack" />

        <!-- 系统异常跳转页面 -->
        <global-results>
            <result name="exception">/common/500.jsp</result>
            <result name="invalid.token">/common/token-error.jsp</result>
        </global-results>

        <!-- 系统异常处理错误影射 -->
        <global-exception-mappings>
            <exception-mapping result="exception" exception="java.lang.Exception"></exception-mapping>
        </global-exception-mappings>

    </package>

</struts>    

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>opt</display-name>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:spring*.xml</param-value>
  </context-param>
  <filter>
    <filter-name>CacheFilter</filter-name>
    <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
    <init-param>
      <param-name>time</param-name>
      <param-value>3600</param-value>
    </init-param>
    <init-param>
      <param-name>scope</param-name>
      <param-value>application</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CacheFilter</filter-name>
    <url-pattern>/common/*</url-pattern>
  </filter-mapping>
  <listener>  
         <listener-class>ch.qos.logback.ext.spring.web.LogbackConfigListener</listener-class>  
</listener> 
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>authorityFilter</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
      <param-name>targetFilterLifecycle</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>excludeEqualUrls</param-name>
      <param-value>/,/index,/login,/logout,/checkCode,/login.jsp,/monitor,/table/view,/teleSale/customer/addNewRegister,/teleSale/customer/addMarketUser,/Bussiness/update</param-value>
    </init-param>
    <init-param>
      <param-name>excludeStartUrls</param-name>
      <param-value>/menu/</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>authorityFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>struts-prepare</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts-prepare</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>sitemesh</filter-name>
    <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>struts-execute</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts-execute</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <session-config>
    <session-timeout>120</session-timeout>
  </session-config>
  <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/common/500.jsp</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/common/500.jsp</location>
  </error-page>
  <error-page>
    <error-code>403</error-code>
    <location>/common/403.jsp</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/common/404.jsp</location>
  </error-page>
  <welcome-file-list>
    <welcome-file>index</welcome-file>
  </welcome-file-list>
</web-app>

大家帮忙看下配置文件哪有问题?感谢

问题补充:

pom.xml

刘竹青的主页 刘竹青 | 初学一级 | 园豆:111
提问于:2018-01-10 18:15
< >
分享
所有回答(1)
0

已解决!!!!!!

刘竹青 | 园豆:111 (初学一级) | 2018-01-11 12:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册