Created
October 2, 2014 18:11
-
-
Save DmitryVarennikov/259156e18b2ac5660dc2 to your computer and use it in GitHub Desktop.
Custom app initializer
This file contains 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
package cuenation.api; | |
import org.springframework.web.WebApplicationInitializer; | |
import org.springframework.web.filter.ShallowEtagHeaderFilter; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletException; | |
public class AppInitializer implements WebApplicationInitializer { | |
/** | |
* Configure the given {@link javax.servlet.ServletContext} with any servlets, filters, listeners | |
* context-params and attributes necessary for initializing this web application. See | |
* examples {@linkplain org.springframework.web.WebApplicationInitializer above}. | |
* | |
* @param servletContext the {@code ServletContext} to initialize | |
* @throws javax.servlet.ServletException if any call against the given {@code ServletContext} | |
* throws a {@code ServletException} | |
*/ | |
@Override | |
public void onStartup(ServletContext servletContext) throws ServletException { | |
servletContext | |
.addFilter("ETag", ShallowEtagHeaderFilter.class) | |
.addMappingForUrlPatterns(null, false, "/cue-categories"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment