你好,我是用春天開機,RESTful Web服務和angularjs,請求方法 '刪除' 不支持angularsjs springboot
這是我restControlleur
@RestController
@RequestMapping("/structure")
public class StructureNotificationRestContolleur {
@Autowired
StructureNotificationService StructureNotif;
@Autowired
ChampService champService;
@RequestMapping(value = "/deleteChamp/{ch}", method=RequestMethod.DELETE)
public @ResponseBody void DeleteChamp(@PathVariable (value="ch") int ch)
{
champService.DeleteChamp(ch);
}
有按鈕刪除:
$scope.deleteST= function(ids)
{
$http.delete('/structure/deleteChamp/'+ids).
success(function(data) {
alert(ids);
});
}
,但有錯誤: osweb.servlet.PageNotFound:請求方法 '刪除' 不支持
???
什麼是「/ structure/deleteChamp /'+ ids'?它存在嗎? – Pogrindis
/structure/deleteChamp /它是要刪除的其餘方法的路徑,「ids」是要刪除的元素的ID? –
我認爲春季開機不知道方法'刪除'???請求方法'DELETE'不支持 –