|
|
|
@ -1,11 +1,7 @@
|
|
|
|
|
package com.wayn.mobile.framework.config;
|
|
|
|
|
|
|
|
|
|
import com.wayn.common.config.WaynConfig;
|
|
|
|
|
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.web.servlet.DispatcherServlet;
|
|
|
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
|
|
|
@ -18,14 +14,14 @@ public class MvcConfig implements WebMvcConfigurer {
|
|
|
|
|
registry.addResourceHandler("/upload/**").addResourceLocations("file:" + WaynConfig.getUploadDir() + "/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public ServletRegistrationBean dispatcherRegistration() {
|
|
|
|
|
return new ServletRegistrationBean(dispatcherServlet());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean(name = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
|
|
|
|
|
public DispatcherServlet dispatcherServlet() {
|
|
|
|
|
return new WaynDispatcherServlet();
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// @Bean
|
|
|
|
|
// public ServletRegistrationBean dispatcherRegistration() {
|
|
|
|
|
// return new ServletRegistrationBean(dispatcherServlet());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Bean(name = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME)
|
|
|
|
|
// public DispatcherServlet dispatcherServlet() {
|
|
|
|
|
// return new WaynDispatcherServlet();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|