当前位置: 首页>>代码示例>>Java>>正文


Java CommonsMultipartResolver.setMaxUploadSize方法代码示例

本文整理汇总了Java中org.springframework.web.multipart.commons.CommonsMultipartResolver.setMaxUploadSize方法的典型用法代码示例。如果您正苦于以下问题:Java CommonsMultipartResolver.setMaxUploadSize方法的具体用法?Java CommonsMultipartResolver.setMaxUploadSize怎么用?Java CommonsMultipartResolver.setMaxUploadSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.multipart.commons.CommonsMultipartResolver的用法示例。


在下文中一共展示了CommonsMultipartResolver.setMaxUploadSize方法的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;
    }
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:10,代码来源:SpringDispatcherConfig.java

示例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;
}
 
开发者ID:ageldama,项目名称:glados-wiki,代码行数:19,代码来源:MultipartResolverContext.java

示例3: filterMultipartResolver

import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
public CommonsMultipartResolver filterMultipartResolver(){
	CommonsMultipartResolver b = new CommonsMultipartResolver();
	b.setMaxUploadSize(
		environment.getProperty(
				"springfield.multipart.size", 
				Long.class, 
				new Long(-1)
				)
	);
	return b;
}
 
开发者ID:u2ware,项目名称:springfield,代码行数:13,代码来源:BaseMultipartConfiguration.java

示例4: 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;
}
 
开发者ID:lemon-china,项目名称:lemon-fileservice,代码行数:9,代码来源:SpringConfiguration.java

示例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;
}
 
开发者ID:lordking,项目名称:spring-rest-sample,代码行数:10,代码来源:WebConfig.java

示例6: 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  ;
}
 
开发者ID:hosken5,项目名称:spring-boot-freemarker-showcase,代码行数:9,代码来源:SiteConfig.java

示例7: getMultipartResolver

import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean(name = "multipartResolver")
public CommonsMultipartResolver getMultipartResolver() {
	// TODO properties.driven config of multiPartConfig
	CommonsMultipartResolver multipart = new CommonsMultipartResolver();
	multipart.setMaxUploadSizePerFile(1024 * 1024 * 5);
	multipart.setMaxUploadSize(1024 * 1024 * 20);
	return multipart;
}
 
开发者ID:th-schwarz,项目名称:bacoma,代码行数:9,代码来源:WebInitializer.java

示例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;
}
 
开发者ID:pablogrela,项目名称:members_cuacfm,代码行数:13,代码来源:ApplicationConfig.java

示例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;
}
 
开发者ID:xxing1982,项目名称:EDU_SYZT,代码行数:8,代码来源:WebAppContext.java

示例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;
}
 
开发者ID:wastevens,项目名称:ElysiumFrontend,代码行数:8,代码来源:AppConfig.java

示例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;
}
 
开发者ID:qatang,项目名称:ctm,代码行数:8,代码来源:WebConfig.java

示例12: multipartResolver

import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean
  public MultipartResolver multipartResolver () {
    final long DEFAULT_MAX_UPLOAD_SIZE = 1024L * 1024L * 200; // 200Mb

    //TODO: find a better way to bypass Spring controllers for OpenRefine
    CommonsMultipartResolver resolver = new CommonsMultipartResolver (){
      @Override
      public boolean isMultipart(HttpServletRequest request){        
        if(request.getServletPath().startsWith ("/annotations")){
          if(request.getServletPath().endsWith("/row/import") || request.getServletPath().endsWith("/column/import"))
            //annotation import is handled by AnnotationConroller
            return super.isMultipart (request);
          else
            //Let OpenRefine handle parsing of the multipart request
            return false;
        }else{
          return super.isMultipart (request);
        }
        
      }
    };
//    StandardServletMultipartResolver resolver = new StandardServletMultipartResolver ();
    resolver.setMaxUploadSize (environment.getProperty ("multipart.upload.max.size",
                                                        Long.class,
                                                        DEFAULT_MAX_UPLOAD_SIZE));
    resolver.setResolveLazily (true);
    return resolver;
  }
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:29,代码来源:MultipartUploadConfiguration.java

示例13: 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;
}
 
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:9,代码来源:AlfrescoMvcServletContextConfig.java

示例14: 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;
}
 
开发者ID:jegbjerg,项目名称:webapp-base,代码行数:10,代码来源:WebConfig.java

示例15: multipartResolver

import org.springframework.web.multipart.commons.CommonsMultipartResolver; //导入方法依赖的package包/类
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() throws IOException {
    CommonsMultipartResolver resolver = new CommonsMultipartResolver();
    resolver.setMaxUploadSize(MAX_UPLOAD_SIZE);
    return resolver;
}
 
开发者ID:FlowCI,项目名称:flow-platform,代码行数:7,代码来源:WebConfig.java


注:本文中的org.springframework.web.multipart.commons.CommonsMultipartResolver.setMaxUploadSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。