web.xml 3.39 KB
<?xml version="1.0" encoding="UTF-8" ?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="
             http://java.sun.com/xml/ns/j2ee  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
         ">

    <!-- 初始化日志系统 -->
    <listener>
        <listener-class>com.alibaba.citrus.logconfig.LogConfiguratorListener</listener-class>
    </listener>

    <!-- 装载/WEB-INF/webx.xml, /WEB-INF/webx-*.xml -->
    <listener>
        <listener-class>com.alibaba.citrus.webx.context.WebxContextLoaderListener</listener-class>
    </listener>

    <context-param>
        <param-name>kissoConfigLocation</param-name>
        <param-value>classpath:setting.properties</param-value>
    </context-param>
    <listener>
        <listener-class>com.xiniunet.supporting.sso.web.KissoConfigListener</listener-class>
    </listener>

    <filter>
        <filter-name>sso</filter-name>
        <filter-class>com.xiniunet.supporting.sso.web.filter.SSOFilter</filter-class>
        <init-param>
            <!-- 排除微信授权相关页面 -->
            <param-name>over.url</param-name>
            <param-value>*.txt;/wechat/url.do;/wechat/action.do;/wechat/jump.do;/wechat/warn.htm</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>sso</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>role</filter-name>
        <filter-class>com.xiniunet.tutorial.filter.Authorizations</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>role</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>mdc</filter-name>
        <filter-class>com.alibaba.citrus.webx.servlet.SetLoggingContextFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>mdc</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>webx</filter-name>
        <filter-class>com.alibaba.citrus.webx.servlet.WebxFrameworkFilter</filter-class>
        <init-param>
            <param-name>excludes</param-name>
            <param-value><!-- 需要被“排除”的URL路径,以逗号分隔,如/static, *.jpg。适合于映射静态页面、图片。 --></param-value>
        </init-param>
        <init-param>
            <param-name>passthru</param-name>
            <param-value><!-- 需要被“略过”的URL路径,以逗号分隔,如/myservlet, *.jsp。适用于映射servlet、filter。
                对于passthru请求,webx的request-contexts服务、错误处理、开发模式等服务仍然可用。 --></param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>webx</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <error-page>
        <error-code>401</error-code>
        <location>/401.html</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/403.html</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/404.html</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/500.html</location>
    </error-page>

    <welcome-file-list>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>

</web-app>