package com.example.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@Configuration
@Import({ SpringMVCContext.class, PersistenceContext.class })
@ComponentScan(basePackages = { "com.example.service" })
@PropertySource("classpath:application.properties")
public class ApplicationContext {
@Bean
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("utf-8");
resolver.setMaxUploadSize(-1);
return resolver;
}
}