Created
September 6, 2013 11:38
-
-
Save mallim/6462665 to your computer and use it in GitHub Desktop.
Example of the setup in order to use Jersey1+Spring+Jackson 2 in the root path
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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app 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" | |
version="3.0" | |
metadata-complete="true" | |
> | |
<display-name>Archetype Created Web Application</display-name> | |
<context-param> | |
<param-name>log4jConfigLocation</param-name> | |
<param-value>/WEB-INF/log4j.xml</param-value> | |
</context-param> | |
<context-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value> | |
/WEB-INF/conf/applicationContext.xml | |
</param-value> | |
</context-param> | |
<listener> | |
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> | |
</listener> | |
<listener> | |
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> | |
</listener> | |
<filter> | |
<filter-name>jersey-filter</filter-name> | |
<filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class> | |
<init-param> | |
<param-name>com.sun.jersey.config.property.packages</param-name> | |
<param-value>PUT_YOUR_JAVA_PACKAGE_HERE,com.fasterxml.jackson.jaxrs.json</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.config.feature.Redirect</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.config.feature.FilterForwardOn404</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.config.feature.ImplicitViewables</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name> | |
<param-value> | |
/(js|images|css|(JSP_LOCATION_TO_USE_AS_VIEWS))/.* | |
</param-value> | |
</init-param> | |
<init-param> | |
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name> | |
<param-value>JSP_LOCATION_TO_USE_AS_VIEWS</param-value> | |
</init-param> | |
</filter> | |
<filter-mapping> | |
<filter-name>jersey-filter</filter-name> | |
<url-pattern>/*</url-pattern> | |
</filter-mapping> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment