클라이언트가 메서드를 "대상 지정"하지 못했습니다. 서버 로그에 피드백이 없습니다. 어느 것이 나에게 아주 이상합니다. 내 방법으로 정의된다클라이언트가 스프링 메서드를 타겟팅 할 수 없습니다.
은 다음과 같습니다 크롬에서
@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
}
내 네트워크 관리자는 다음과 같습니다 :
@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
}
그것은 작동 folow 방법과 거의 같은 글의의 실패한 :
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이 발생하는 이유를 알아낼 수 있습니까? 추가 정보가 필요하면 바로 연락하겠습니다. :) 읽어 주셔서 감사합니다.
유일한 차이점 인 것처럼 보이는'reUploadFile'에서'@ResponseBody()'를 제거해보십시오. 계속 유지하고자하는 경우 예외 양식을 서버에 게시하십시오. –
오류 로그를 게시 할 수 있습니까 –
@SanjayaLiyanage 서버 로그에 의견이 없습니다. 그래서 종류의 오류 로그도 의미하지 않습니다. 그 외 감사합니다 :) –