我的客户未能“定位”一种方法,我在服务器日志中没有得到反馈。这对我来说很奇怪。
我的方法定义如下:
@RequestMapping(value = "/reUploadFile/{userId}/{fileId}", method = RequestMethod.POST, headers = "Accept=*")
public @ResponseBody()
void reUploadFile(@PathVariable("userId") int userId, @PathVariable("fileId") int fileId,
@RequestParam(value = "file") MultipartFile multipartFile,
Model model, HttpServletRequest request, HttpServletResponse response) {
...Stuff happends doesn't get called
}
它几乎与以下有效的方法相同:
@RequestMapping(value = "/uploadFile/{companiesId}/{day}/{month}/{year}/{userId}",
method = RequestMethod.POST, headers = "Accept=*")
public void uploadFile(@PathVariable("companiesId") long companiesId,
@PathVariable("day") int day, @PathVariable("month") int month,
@PathVariable("year") int year, @PathVariable("userId") int userId,
@RequestParam(value = "file") MultipartFile multipartFile,
Model model, HttpServletRequest request, HttpServletResponse response) {
...content
}
我在 chrome 中的网络管理器如下所示: 失败:
Request URL:http://localhost:8080/MyProject.spring/spring/reUploadFile/3821211/154329
Request Method:POST
Status Code:500 Internal Server Error
成功者:
Request URL:http://localhost:8080/MyProject.spring/spring/uploadFile/25974093/01/06/2013/3821211
Request Method:POST
Status Code:200 OK
谁能弄清楚为什么我在这里收到错误 500?如果您需要更多信息,请您好,我会告诉您的 :) 感谢您的阅读 :)