后臺只能接收get請求,使用post傳值接收的數據為null問題出現的環(huán)境背景及自己嘗試過哪些方法打斷點看了一下post請求傳過來的值為null使用postman測試的,本以為是測試軟件的問題,之后自己寫了一個form表單測試,結果相同,使用post傳值不能接收到數據相關代碼// 請把代碼文本粘貼到下方(請勿用圖片代替代碼)@RequestMapping(value = "login.do", method = RequestMethod.GET)
@ResponseBodypublic ServerResponse<User> login(String username,String password, HttpSession session){
ServerResponse<User> response = iUserService.login(username,password); if(response.isSuccess()){
session.setAttribute(Const.CURRENT_USER,response.getData());
}
return response;
}你期待的結果是什么?實際看到的錯誤信息又是什么?username 和 password 應該可以接收到前端傳過來的值但是實際上并沒有接收到,值為null
添加回答
舉報
0/150
提交
取消