Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (288940) exceeds the configured maximum (128000)
解决方法:
1、打开文件:xxx\grails-app\conf\spring\resources.groovy
2、导入CommonsMultipartResolver需要的jar包
3、写上以下代码即可
// Place your Spring DSL code here
import org.springframework.web.multipart.commons.CommonsMultipartResolver
beans = {
// 默认上传文件大小
multipartResolver(CommonsMultipartResolver){
maxUploadSize = 41943040 // 40MB
maxInMemorySize = 41943040
defaultEncoding = "utf-8"
}
}