2
GET 요청을받는 다른 Spring 컨트롤러로 요청을 전달하려하지만 POST가 지원되지 않는다고 알려줍니다. 다음은 POST 함수를 사용하는 첫 번째 컨트롤러 메소드의 관련 부분입니다. 로그인 함수로 사용하고 있기 때문입니다.Spring 3 - 전달에서 GET 요청을 수행하는 방법
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String login(@ModelAttribute("administrator") Administrator administrator,
Model model) {
// code that's not germane to this problem
return "forward:waitingBulletins";
}
다음은 앞으로 전달할 방법입니다.
@RequestMapping(value = "/waitingBulletins", method = RequestMethod.GET)
public String getWaitingBulletins(Model model) {
// the actual code follows
}
다음은 브라우저의 오류 메시지입니다. 당신이 POST
요청을 전달하고 그것을 위해 핸들러를 누락 있도록
HTTP Status 405 - Request method 'POST' not supported
--------------------------------------------------------------------------------
type Status report
message Request method 'POST' not supported
description The specified HTTP method is not allowed for the requested resource (Request method 'POST' not supported).
감사합니다. 이것은 나를 위해 일했다. –