問題描述后臺只能接收get請求,使用post傳值接收的數據為null問題出現的環境背景及自己嘗試過哪些方法打斷點看了一下post請求傳過來的值為null使用postman測試的,本以為是測試軟件的問題,之后自己寫了一個form表單測試,結果相同,使用post傳值不能接收到數據相關代碼//請把代碼文本粘貼到下方(請勿用圖片代替代碼)@RequestMapping(value="login.do",method=RequestMethod.GET)@ResponseBodypublicServerResponselogin(Stringusername,Stringpassword,HttpSessionsession){ServerResponseresponse=iUserService.login(username,password);if(response.isSuccess()){session.setAttribute(Const.CURRENT_USER,response.getData());}returnresponse;}你期待的結果是什么?實際看到的錯誤信息又是什么?username和password應該可以接收到前端傳過來的值但是實際上并沒有接收到,值為null
后臺只能接收get請求,使用post傳值接收的數據為null,這是咋地了?
冉冉說
2019-05-12 15:18:52