하나의 개체를 다른 개체에 추가하고 다른 개체를 삭제하기위한 테이블이 있습니다. 내가 URL로 이동하면이 내 Thymeleaf보기요청 방법 삭제시 GET 지원되지 않음
<td>
<form action = "#" th:action="@{/proj/{pid}/coupling/{r1}/{r2} (pid=${projectID},r1=${r1ID},r2=${r2.id})}" method = "post">
<input type="submit" name="Couple" value="Couple" class="btn btn-info" />
</form>
</td>
<td">
<form action = "#" th:action="@{/proj/{pid}/coupling/{r1}/{r2} (pid=${projectID},r1=${r1ID},r2=${r2.id})}" method = "delete">
<input type="submit" name="RemoveCoupling" value="RemoveCoupling" class="btn btn-info" />
</form>
</td>
이
@Controller
@RequestMapping("/proj/{pid}/coupling/{r1}")
public class CouplingController {
@RequestMapping(method = RequestMethod.GET)
public String getAllCouplings(){
return "riskCoupling";
}
@RequestMapping(value = "/{r1}", method = RequestMethod.POST)
public String saveCoupling(){
return "/projects";
}
@RequestMapping(value = "/{r2}", method = RequestMethod.DELETE)
public String removeCoupling(){
return "/projects";
}
입니다
"/ {PID}/커플 링/{(R1)} /를 PROJ"내가 얻을 :이
내 컨트롤러 개요 그래서 GET 작동합니다. 커플 버튼을 누르면 작동합니다. 그래서 POST가 작동합니다. RemoveCoupling 버튼을 누르면 오류가 발생합니다 : 요청 방법 "Get"이 지원되지 않습니다.이 오류가 발생하는 이유는 무엇입니까?
가능하면 같은 문제가 : https://stackoverflow.com/questions/ 13629653/using-put-and-delete- 봄에서 메서드 - mvc –