本文整理汇总了Java中org.springframework.web.multipart.commons.CommonsMultipartResolver.setDefaultEncoding方法的典型用法代码示例。如果您正苦于以下问题:Java CommonsMultipartResolver.setDefaultEncoding方法的具体用法?Java CommonsMultipartResolver.setDefaultEncoding怎么用?Java CommonsMultipartResolver.setDefaultEncoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.multipart.commons.CommonsMultipartResolver
的用法示例。
在下文中一共展示了CommonsMultipartResolver.setDefaultEncoding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean(name = "multipartResolver")
public CommonsMultipartResolver getResolver() throws IOException{
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setMaxUploadSizePerFile(5242880);
resolver.setMaxUploadSize(52428807);
resolver.setDefaultEncoding("UTF-8");
return resolver;
}
示例2: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public MultipartResolver multipartResolver(WikiConfig wikiConfig) {
final String UPLOAD_TEMP_DIR = wikiConfig.getUploadTempDir();
//
CommonsMultipartResolver mr = new CommonsMultipartResolver();
mr.setMaxUploadSize(MAX_UPLOAD_SIZE);
mr.setDefaultEncoding(DEFAULT_ENCODING);
try {
Resource uploadTempDir = resourceLoader
.getResource(UPLOAD_TEMP_DIR);
mr.setUploadTempDir(uploadTempDir);
LOG.debug(String.format("UPLOAD TEMP DIR = %s", uploadTempDir));
} catch (IOException e) {
LOG.error(String.format("#getResource(%s) FAIL, FALLBACK.",
UPLOAD_TEMP_DIR), e);
}
return mr;
}
示例3: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
resolver.setMaxInMemorySize(40960);
resolver.setMaxUploadSize(50 * 1024 * 1024);//上传文件大小 50M 50*1024*1024
return resolver;
}
示例4: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver()
{
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("utf-8");
return resolver;
}
示例5: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
final CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setMaxUploadSize(-1);
commonsMultipartResolver.setDefaultEncoding("UTF-8");
return commonsMultipartResolver;
}
示例6: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
final CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("utf-8");
resolver.setMaxUploadSizePerFile(Long.valueOf(env.getRequiredProperty("web.max_upload_size_per_file")));
return resolver;
}
示例7: commonsMultipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver
commonsMultipartResolver(){
CommonsMultipartResolver re = new CommonsMultipartResolver();
re.setMaxUploadSize(1);
re.setDefaultEncoding("utf-8");
return re ;
}
示例8: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
/**
* Multipart resolver.
*
* @return the commons multipart resolver
*/
@Bean
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setDefaultEncoding("utf-8");
commonsMultipartResolver.setMaxUploadSize(50000000);
return commonsMultipartResolver;
}
示例9: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver(){
CommonsMultipartResolver muliMultipartResolver = new CommonsMultipartResolver();
muliMultipartResolver.setMaxUploadSize(MAX_UPLOAD_FILE_SIZE);
muliMultipartResolver.setDefaultEncoding(DEFAULT_ENCODING);
return muliMultipartResolver;
}
示例10: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver(){
CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setDefaultEncoding("utf-8");
commonsMultipartResolver.setMaxUploadSize(50000000);
return commonsMultipartResolver;
}
示例11: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setDefaultEncoding(CharsetConstants.CHARSET_UTF8);
commonsMultipartResolver.setMaxUploadSize(1024 * 1024 * 2);
return commonsMultipartResolver;
}
示例12: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
final CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setMaxUploadSize(-1);
resolver.setDefaultEncoding("utf-8");
configureMultipartResolver(resolver);
return resolver;
}
示例13: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public MultipartResolver multipartResolver() {
final CommonsMultipartResolver resolver = new CommonsMultipartResolver();
// Max upload size: 1 MB
resolver.setMaxUploadSize(1048576);
resolver.setDefaultEncoding(StandardCharsets.UTF_8.name());
resolver.setResolveLazily(true);
return resolver;
}
示例14: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("utf-8");
return resolver;
}
示例15: multipartResolver
import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setDefaultEncoding(StandardCharsets.UTF_8.name());
return new CommonsMultipartResolver();
}