• zbb20170228_spring_web.xml


    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <display-name></display-name>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    
        <!-- 配置spring mvc -->
        <servlet>
            <servlet-name>spring</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>classpath:com/zbb/config/spring-servlet.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>spring</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
        <!-- 配置spring -->
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:com/zbb/config/applicationContext.xml</param-value>
        </context-param>
        <!-- log4j -->
        <listener>
            <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
        </listener>
        <context-param>
            <param-name>log4jConfigLocation</param-name>
            <param-value>classpath:com/zbb/config/log4j.properties</param-value>
        </context-param>
        <context-param>
            <param-name>log4jRefreshlnterval</param-name>
            <param-value>6000</param-value>
        </context-param>
        <!-- 配置字符编码 -->
        <filter>
            <filter-name>characterEncodingFilter</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>
            <init-param>
                <param-name>forceEncoding</param-name>
                <param-value>true</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>characterEncodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
        
        <!-- 错误页面配置 -->
        <error-page>
            <error-code>404</error-code>
            <location>/WEB-INF/jsp/error/HTTP_404.jsp</location>
        </error-page>
        <error-page>
            <error-code>500</error-code>
            <location>/WEB-INF/jsp/error/HTTP_500.jsp</location>
        </error-page>
    </web-app>
     
  • 相关阅读:
    小技巧:Sidebar上的Recent Posts如何排除某类别下的文章
    64位windows下,C# 访问 Lotus Domino Objects 时访问Com注册类失败原因
    ODP.net 及System.Data.OracleClient使用二三事
    收发超长短信的资料汇编
    python 3 中建立可迭代对象(making object iterable)
    悲催的PHP新型字符串
    wp下如何禁止分类列表列出某个分类
    人生的12句Comperehend领悟-感悟颇深
    RegexBuddyV3.03正则表达式工具下载
    《越狱》里玫瑰花的制作方法(超详细)
  • 原文地址:https://www.cnblogs.com/super-admin/p/6481000.html
Copyright © 2020-2023  润新知