多數原因是Bean沒有正確註冊,造成的原因有:
1、@ComponentScan('....')中省略號是不是沒有寫對
2、註解是不是沒有加,例如@Component,@Service,@Controller,@Repository。
多數原因是Bean沒有正確註冊,造成的原因有:
1、@ComponentScan('....')中省略號是不是沒有寫對
2、註解是不是沒有加,例如@Component,@Service,@Controller,@Repository。
1、 2、 3、 4、 5、 6、 7、運行 HelloWorld 啓動後內置的Tomcat服務器也同時啓動起來了,然後在瀏覽器中輸入 localhost:8080/hello