web.xml 9.45 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
    <display-name>hand-hap</display-name>
    <description>hand-hap</description>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:/spring/applicationContext*.xml</param-value>
    </context-param>
    <context-param>
        <param-name>spring.profiles.default</param-name>
        <param-value>default</param-value>
    </context-param>
    <context-param>
        <param-name>contextInitializerClasses</param-name>
        <param-value>com.hand.hap.core.CustomApplicationContextInitializer</param-value>
    </context-param>
    <context-param>
        <param-name>propertiesFile</param-name>
        <param-value>classpath:/config.properties</param-value>
    </context-param>

    <listener>
        <listener-class>com.hand.hap.core.web.HapContextLoadListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>cors</filter-name>
        <filter-class>com.hand.hap.security.CORSFilter</filter-class>
        <async-supported>true</async-supported>
        <init-param>
            <param-name>allowedMappings</param-name>
            <param-value>/oauth/**;/api/**;/r/api/**</param-value>
        </init-param>
        <init-param>
            <param-name>allowedHeader</param-name>
            <param-value>*</param-value>
        </init-param>
        <init-param>
            <param-name>allowedOrigin</param-name>
            <param-value>*</param-value>
        </init-param>
        <init-param>
            <param-name>allowedMethod</param-name>
            <param-value>*</param-value>
        </init-param>
        <!--<init-param>-->
            <!--<param-name>allowCredentials</param-name>-->
            <!--<param-value>true</param-value>-->
        <!--</init-param>-->
        <!--<init-param>-->
            <!--<param-name>maxAge</param-name>-->
            <!--<param-value>3600</param-value>-->
        <!--</init-param>-->
        <!--<init-param>-->
        <!--<param-name>exposedHeader</param-name>-->
        <!--<param-value>header1;header2</param-value>-->
        <!--</init-param>-->
    </filter>
    <filter-mapping>
        <filter-name>cors</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
       <async-supported>true</async-supported>
        <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>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>hap-enhance</filter-name>
        <filter-class>com.hand.hap.core.web.HapEnhanceFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>hap-enhance</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>spring-session</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <async-supported>true</async-supported>
        <init-param>
            <param-name>targetBeanName</param-name>
            <param-value>springSession</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>spring-session</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>preRequestFilter</filter-name>
        <filter-class>com.hand.hls.filter.GlobalExceptionFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>preRequestFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--spring security配置-->
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <async-supported>true</async-supported>
    </filter>

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

    <!-- metrics.servlet -->
    <filter>
        <filter-name>instrumentedFilter</filter-name>
        <filter-class>com.codahale.metrics.servlet.InstrumentedFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>instrumentedFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--
    Included to support Single Logout. Note that the SingleSignOutFilter is included in the
    springSecurityFilterChain. However, it could also be placed as the first filter-mapping
    in the web.xml
    启用CAS SSO时添加下面的配置
    -->
    <!--
        <listener>
            <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
        </listener>
     -->
    <!--<filter>-->
    <!--<filter-name>springSecurityFilterChain</filter-name>-->
    <!--<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>-->
    <!--</filter>-->
    <!--<filter-mapping>-->
    <!--<filter-name>springSecurityFilterChain</filter-name>-->
    <!--<url-pattern>/*</url-pattern>-->
    <!--</filter-mapping>-->

    <!-- <filter> <filter-name>csrfFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <async-supported>true</async-supported> </filter> <filter-mapping> <filter-name>csrfFilter</filter-name>
        <url-pattern>/*</url-pattern> </filter-mapping> -->

    <!-- leaf-->
    <servlet>
        <servlet-name>service</servlet-name>
        <servlet-class>leaf.service.http.FacadeServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>autocrud</servlet-name>
        <servlet-class>leaf.service.http.AutoCrudServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>service</servlet-name>
        <url-pattern>*.lview</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>service</servlet-name>
        <url-pattern>*.lsc</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>autocrud</servlet-name>
        <url-pattern>/autocrud/*</url-pattern>
    </servlet-mapping>
    <!-- leaf end-->

    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/ws/*</url-pattern>
    </servlet-mapping>


    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:/spring/appServlet/servlet*.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>

    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- metrics.servlet -->
    <servlet>
        <servlet-name>metrics</servlet-name>
        <servlet-class>com.codahale.metrics.servlets.AdminServlet</servlet-class>
        <async-supported>true</async-supported>
    </servlet>
    <servlet-mapping>
        <servlet-name>metrics</servlet-name>
        <url-pattern>/metrics/*</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>jacob</servlet-name>
        <servlet-class>hls.plugin.jacob.servlet.OfficeConvertServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>jacob</servlet-name>
        <url-pattern>/jacob/*</url-pattern>
    </servlet-mapping>




    <!--<servlet>-->
        <!--<servlet-name>ureportServlet</servlet-name>-->
        <!--<servlet-class>com.bstek.ureport.console.UReportServlet</servlet-class>-->
    <!--</servlet>-->
    <!--<servlet-mapping>-->
        <!--<servlet-name>ureportServlet</servlet-name>-->
        <!--<url-pattern>/ureport/*</url-pattern>-->
    <!--</servlet-mapping>-->
    <error-page>
        <error-code>400</error-code>
        <location>/500.html</location>
    </error-page>
    <error-page>
        <error-code>401</error-code>
        <location>/500.html</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/500.html</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/500.html</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/500.html</location>
    </error-page>

</web-app>