Springboot配置文件解析器

@EnableScheduling
@MapperScan(value = "com.****.dao")
@EnableTransactionManagement
@EnableAutoConfiguration(exclude = { MultipartAutoConfiguration.class })
@EnableAsync
@SpringBootApplication
public class CispHistoryApplication { public static void main(String[] args) {
SpringApplication.run(CispHistoryApplication.class, args);
} // 显示声明CommonsMultipartResolver为mutipartResolver
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
resolver.setResolveLazily(true);// resolveLazily属性启用是为了推迟文件解析,以在在UploadAction中捕获文件大小异常
resolver.setMaxInMemorySize(40960);
resolver.setMaxUploadSize(5 * 1024 * 1024 * 1024);// 上传文件大小 5G
return resolver;
}
}
上一篇:Nginx配置proxy_pass


下一篇:新手sqlserver数据库dba需要注意的小细节