亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

put請求不成功

@PutMapping(value?=?"/personupdate/{id}")
public?Person?personupdate(@PathVariable("id")?Integer?id,
???????????????????????????@RequestParam("name")?String?name,
??????????????????????????@RequestParam("age")?Integer?age){
????Person?person?=?new?Person();
????person.setId(id);
????person.setName(name);
????person.setAge(age);

????return?personRepository.save(person);
}

這是方法

報錯信息如下

{

? ? "timestamp": 1528183498443,

? ? "status": 400,

? ? "error": "Bad Request",

? ? "exception": "org.springframework.web.bind.MissingServletRequestParameterException",

? ? "message": "Required String parameter 'name' is not present",

? ? "path": "/personupdate/1"

}


正在回答

1 回答

@RestController

@RequestMapping("/user")

public class IndexController {

@RequestMapping(value = "/index", method = RequestMethod.GET)

public String index() {

return "index";

}

}

看看這個是不是哪不全

0 回復 有任何疑惑可以回復我~
#1

行者無涯

一般不建議使用get,容易被攻擊。
2018-06-11 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
2小時學會Spring Boot
  • 參與學習       151526    人
  • 解答問題       1132    個

Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序

進入課程

put請求不成功

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號