最近在用做spring 做文件上传功能,同样的代码,在tomcat中运行正常,
转到weblogic 中部署之后,提交的表单中的file无法通过request传递。
controller方法头部为
@RequestMapping("/saveSysdataTree")
public ModelAndView saveSysdataTree(HttpServletRequest request) throws Exception{
log.info("上传进来了~");
Map<String, Object> map = new HashMap<String, Object>();
在Map那行打上断点,调试时,
log.info()信息能打印出来,查看request的值时发现,
request里面的mutipartFiles参数值为{}空。
尝试过 public ModelAndView upload(@RequestParam("alais")
String name, @RequestParam("file")
MultipartFile file,HttpServletRequest request) throws Exception {
System.out.println("进来了!");
这种写法,在tomcat里面能正常运行,在weblogic中部署完执行上传功能时,
报异常:
at:[2014-10-16 18:34:42] ERROR ExceptionHandler:49 - ExceptionHandler error====
org.springframework.web.bind.MissingServletRequestParameterException: Required MultipartFile parameter 'file' is not present
(tomcat中一切正常,)
求各路大神指点~