[英]Bad request 400
我有Spring / Hibernate / MVC / Maven應用程序。 我想通過請求URI發送對象的ID。
這是我的控制器:
@RequestMapping(value = "/editCase", method = RequestMethod.GET)
public String getEditCase(@PathVariable("id") Long id, ModelMap model) {
System.out.println("reached!");
....
return "editCase";
}
但是,當我嘗試檢索此頁面時,出現400請求錯誤。
此錯誤的原因是什么? 我的請求格式如何? 非常感謝你。
您正在使用PathVariable
因此需要在value
聲明id
。 例如
@RequestMapping(value = "/editCase/{id}", method = RequestMethod.GET)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.