springboot測試的時候報404(Whitelabel Error Page)

springboot測試 剛學習springboot的時候一直http://localhost:8080/hello一直報錯,後面發現如果兩個類不在一個包下,或者子包下,是無法掃描到的。 這個時候可以增加註解ComponentScan(value = 「com.itsm」)即可 @SpringBootApplication @ComponentScan(value = 「com.itsm」) pu
相關文章
相關標籤/搜索