Skip to content

Instantly share code, notes, and snippets.

@rzenkov
Created October 1, 2013 12:44
Show Gist options
  • Select an option

  • Save rzenkov/6777865 to your computer and use it in GitHub Desktop.

Select an option

Save rzenkov/6777865 to your computer and use it in GitHub Desktop.
Configuring spring mvc without web.xml
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