Added default servlet enabling in the test app to be able to serve static resources from the webapp.

This commit is contained in:
Jon Brisbin
2012-09-27 15:51:36 -05:00
committed by Jon Brisbin
parent cff8065d8d
commit 3ffae1a1ec

View File

@@ -9,6 +9,7 @@ import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
/**
* @author Jon Brisbin
@@ -28,6 +29,8 @@ public class RestExporterWebInitializer implements WebApplicationInitializer {
ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", servlet);
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/*");
new DefaultServletHandlerConfigurer(servletContext).enable();
}
}