Created
March 2, 2014 07:16
-
-
Save sivaprasadreddy/9303094 to your computer and use it in GitHub Desktop.
SpringDataREST SpringWebAppInitializer.java
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 com.sivalabs.springdatarest.web.config; | |
import javax.servlet.Filter; | |
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; | |
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter; | |
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; | |
import com.sivalabs.springdatarest.config.AppConfig; | |
public class SpringWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer | |
{ | |
@Override | |
protected Class<?>[] getRootConfigClasses() | |
{ | |
return new Class<?>[] { AppConfig.class}; | |
} | |
@Override | |
protected Class<?>[] getServletConfigClasses() | |
{ | |
return new Class<?>[] { WebMvcConfig.class, RepositoryRestMvcConfiguration.class }; | |
} | |
@Override | |
protected String[] getServletMappings() | |
{ | |
return new String[] { "/rest/*" }; | |
} | |
@Override | |
protected Filter[] getServletFilters() { | |
return new Filter[]{ | |
new OpenEntityManagerInViewFilter() | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment