org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug
2018-06-05 14:00
1056 查看
之前做的项目是resteasy的上传,代码没有问题,断点都不进来呢。
我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput,
用MultipartFile就可以了。老的无法兼容新的。正确代码如下
我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput,
用MultipartFile就可以了。老的无法兼容新的。正确代码如下
@RequestMapping(value="/importExcelForEduQuestion",produces="application/json;charset=utf-8") @ResponseBody //@RequiresPermissions("eduQuestionBank:importExcelForEduQuestion") publicMap<String,Object>importExcelForEduQuestion(HttpServletRequestrequest,@RequestParam("excelPath")MultipartFilefile){ //如果文件不为空,写入上传路径 if(!file.isEmpty()){ //上传文件路径 //上传文件名 Stringfilename=file.getOriginalFilename(); Filefilepath=newFile(UPLOADED_FILE_PATH,filename); //判断路径是否存在,如果不存在就创建一个 if(!filepath.getParentFile().exists()){ filepath.getParentFile().mkdirs(); } //将上传文件保存到一个目标文件当中 try{ file.transferTo(newFile(UPLOADED_FILE_PATH+File.separator+filename)); }catch(IOExceptione){ e.printStackTrace(); } returnResultUtil.createSuccessResult(); }else{ returnResultUtil.createFailResult("上传失败"); } }
相关文章推荐
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
- Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException
- error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: Unknown column 'viewpoint' in 'field list'
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
- org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is
- 【已解决】org.springframework.web.util.NestedServletException: Request processing failed; nested exceptio
- hibernate org.springframework.web.util.NestedServletException: Request processing failed; nested exc
- HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.BeanInsta
- spring + ibatis错误总结org.springframework.web.util.NestedServletException: Request processing failed; n
- org.springframework.web.util.NestedServletException: Request processing fail
- org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.io.Serializable]:
- org.springframework.web.util.NestedServletException: Request processing fail
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itcast.j