Created
October 1, 2013 12:44
-
-
Save rzenkov/6777865 to your computer and use it in GitHub Desktop.
Configuring spring mvc without web.xml
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
| import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; | |
| public class MyWebInit extends AbstractAnnotationConfigDispatcherServletInitializer{ | |
| @Override | |
| protected Class<?>[] getRootConfigClasses(){ | |
| return null; | |
| } | |
| @Override | |
| protected Class<?> [] getServletConfigClasses() { | |
| return new Class[] { MyWebConfig.class }; | |
| } | |
| @Override | |
| protected String[] getServletMappings() { | |
| return new String[] { "/" }; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment