你好,我使用的是spring boot,restful web service和angularjs,
这是我的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);
});
}
但有错误: o.s.web.servlet.PageNotFound:请求方法' DELETE'不支持
???
答案 0 :(得分:0)
$scope.deleteST= function(ids)
{
$http.delete('/structure/deleteChamp/', ids).
success(function(data) {
alert(ids);
});
}
编辑*** Clarificaction:+参数作为加法意味着你将在操作结果时结束STRING,而#34;," paramether意味着你最终会得到一个字符串url加上你需要的javascript / Json对象。
尝试使用","而不是" +"