Created
September 21, 2014 19:19
-
-
Save sleepiecappy/0b1d23d41fef9b41591a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee | |
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" | |
version="3.1"> | |
<display-name>Spring MVC Application</display-name> | |
<!-- Configure ContextLoaderListener to use AnnotationConfigWebApplicationContext | |
instead of the default XmlWebApplicationContext --> | |
<context-param> | |
<param-name>contextClass</param-name> | |
<param-value> | |
org.springframework.web.context.support.AnnotationConfigWebApplicationContext | |
</param-value> | |
</context-param> | |
<!-- Configuration locations must consist of one or more comma- or space-delimited | |
fully-qualified @Configuration classes. Fully-qualified packages may also be | |
specified for component-scanning --> | |
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value> | |
<!-- Config classes here --> | |
</param-value> | |
</context-param> | |
<!-- Bootstrap the root application context as usual using ContextLoaderListener --> | |
<listener> | |
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> | |
</listener> | |
<!-- Declare a Spring MVC DispatcherServlet as usual --> | |
<servlet> | |
<servlet-name>dispatcher</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> | |
<!-- Configure DispatcherServlet to use AnnotationConfigWebApplicationContext | |
instead of the default XmlWebApplicationContext --> | |
<init-param> | |
<param-name>contextClass</param-name> | |
<param-value> | |
org.springframework.web.context.support.AnnotationConfigWebApplicationContext | |
</param-value> | |
</init-param> | |
<!-- Again, config locations must consist of one or more comma- or space-delimited | |
and fully-qualified @Configuration classes --> | |
<init-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value> | |
<!-- Config classes here --> | |
</param-value> | |
</init-param> | |
</servlet> | |
<!-- map all requests for /app/* to the dispatcher servlet --> | |
<servlet-mapping> | |
<servlet-name>dispatcher</servlet-name> | |
<url-pattern>/</url-pattern> | |
</servlet-mapping> | |
<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> | |
<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> | |
<!-- used so we can use forms of method type 'PUT' and 'DELETE' (such as in the Pet form) | |
see here: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/view.html#rest-method-conversion | |
--> | |
<filter> | |
<filter-name>httpMethodFilter</filter-name> | |
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> | |
</filter> | |
<filter-mapping> | |
<filter-name>httpMethodFilter</filter-name> | |
<servlet-name>dispatcher</servlet-name> | |
</filter-mapping> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment