課程
/后端開(kāi)發(fā)
/Java
/SpringBoot構(gòu)建電商基礎(chǔ)秒殺項(xiàng)目
?????
2020-12-03
源自:SpringBoot構(gòu)建電商基礎(chǔ)秒殺項(xiàng)目 3-5
正在回答
已解決:再重寫(xiě)
@Override public?UserModel?getUserById(Integer?id){ UserDo?userDo?=?userDoMapper.selectByPrimaryKey(id); if?(userDo==null){ ????return?null; ????} }時(shí)?未判空
斷點(diǎn)查看到? 都沒(méi)有走到 if 判斷userModel 為空的之后的邏輯,直接查詢(xún)時(shí)就報(bào)空指針了
舉報(bào)
應(yīng)用SpringBoot快速搭建擁有用戶(hù)、商品、交易及秒殺活動(dòng)的電商秒殺應(yīng)用。
2 回答BusinessException :null 急需解決
2 回答說(shuō)沒(méi)辦法強(qiáng)轉(zhuǎn)成 BusinessException
1 回答service實(shí)現(xiàn)類(lèi)里面的throw new BusinessException(),沒(méi)有在頁(yè)面顯示出來(lái),只有控制臺(tái),但是controller里面的成功
1 回答關(guān)于未知錯(cuò)誤的處理。null指針還能set?BusinessException is never thrown in the method
1 回答為什么異常不能拋出
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2020-12-04
已解決:再重寫(xiě)
2020-12-03
斷點(diǎn)查看到? 都沒(méi)有走到 if 判斷userModel 為空的之后的邏輯,直接查詢(xún)時(shí)就報(bào)空指針了