remove boot from spring-mvc-java
This commit is contained in:
@@ -14,13 +14,20 @@ public class AppInitializer implements WebApplicationInitializer {
|
||||
@Override
|
||||
public void onStartup(ServletContext container) throws ServletException {
|
||||
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
||||
context.setConfigLocation("org.baeldung.config");
|
||||
|
||||
context.scan("com.baeldung");
|
||||
|
||||
container.addListener(new ContextLoaderListener(context));
|
||||
|
||||
ServletRegistration.Dynamic dispatcher = container.addServlet("java-servlet", new DispatcherServlet(context));
|
||||
ServletRegistration.Dynamic dispatcher = container.addServlet("mvc", new DispatcherServlet(context));
|
||||
dispatcher.setLoadOnStartup(1);
|
||||
dispatcher.addMapping("/java-servlet/*");
|
||||
dispatcher.addMapping("/");
|
||||
|
||||
// final MultipartConfigElement multipartConfigElement = new
|
||||
// MultipartConfigElement(TMP_FOLDER, MAX_UPLOAD_SIZE,
|
||||
// MAX_UPLOAD_SIZE * 2, MAX_UPLOAD_SIZE / 2);
|
||||
//
|
||||
// appServlet.setMultipartConfig(multipartConfigElement);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user