List of usage examples for org.springframework.web.servlet DispatcherServlet setContextClass
public void setContextClass(Class<?> contextClass)
From source file:com.github.mjeanroy.junit.servers.samples.jetty.java.configuration.WebApplicationConfiguration.java
private void initSpringMvc(ServletContext servletContext, AnnotationConfigWebApplicationContext context) { DispatcherServlet dispatcherServlet = new DispatcherServlet(context); dispatcherServlet.setContextConfigLocation(configLocation()); dispatcherServlet.setContextClass(AnnotationConfigWebApplicationContext.class); ServletRegistration.Dynamic dispatcher = servletContext.addServlet("spring", dispatcherServlet); dispatcher.setLoadOnStartup(1);//w w w .jav a 2 s . c o m dispatcher.addMapping("/*"); dispatcher.addMapping("/"); }
From source file:com.mjeanroy.backbone_isomorphic.configuration.WebConfiguration.java
private void initSpringMvc(ServletContext servletContext, AnnotationConfigWebApplicationContext context) { DispatcherServlet dispatcherServlet = new DispatcherServlet(context); dispatcherServlet.setContextConfigLocation(configLocation()); dispatcherServlet.setContextClass(AnnotationConfigWebApplicationContext.class); ServletRegistration.Dynamic dispatcher = servletContext.addServlet("spring", dispatcherServlet); dispatcher.setLoadOnStartup(1);//from w w w . ja v a2 s . c om dispatcher.addMapping("/api/*"); dispatcher.addMapping("/"); }