課程
/后端開發(fā)
/Java
/Spring入門篇
為什么每個(gè)類只能有一個(gè)構(gòu)造器被標(biāo)記為required=true????????????????
2016-05-05
源自:Spring入門篇 4-2
正在回答
規(guī)定的吧,如果設(shè)置兩個(gè)構(gòu)造函數(shù)required=true運(yùn)行會(huì)出現(xiàn)下列錯(cuò)誤
Invalid autowire-marked constructor: public com.imooc.beanannotation.jsr.JsrServie(). Found another constructor with 'required' Autowired annotation: public com.imooc.beanannotation.jsr.JsrServie(com.imooc.beanannotation.jsr.JsrDAO)
java家洼 提問者
舉報(bào)
為您帶來IOC和AOP的基本概念及用法,為后續(xù)高級(jí)課程學(xué)習(xí)打下基礎(chǔ)
1 回答構(gòu)造注入時(shí)有多個(gè)構(gòu)造器 怎樣才能找到是那個(gè)構(gòu)造器呢?
1 回答為什么用構(gòu)造器自動(dòng)裝配會(huì)報(bào)錯(cuò)
2 回答為什么我更改構(gòu)造器形參不會(huì)報(bào)錯(cuò)?為什么老師的能報(bào)錯(cuò)
3 回答為什么service中構(gòu)造器方法的sysout的內(nèi)容沒顯示?
3 回答為什么使用Required注解會(huì)有異常?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-05-05
規(guī)定的吧,如果設(shè)置兩個(gè)構(gòu)造函數(shù)required=true運(yùn)行會(huì)出現(xiàn)下列錯(cuò)誤
Invalid autowire-marked constructor: public com.imooc.beanannotation.jsr.JsrServie(). Found another constructor with 'required' Autowired annotation: public com.imooc.beanannotation.jsr.JsrServie(com.imooc.beanannotation.jsr.JsrDAO)