1.
-
問:
Circular view path [index]: would dispatch back to the current handler URL [/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.) -
解:
-
pom.xml 文件添加依賴
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
2.
- 服務(wù)發(fā)布者配置
3.
-
問:
online-content 模塊的 service 里調(diào)用了 online-manager 模塊的 dao 方法霎烙,bean實(shí)例無(wú)法初始化。
-
解:
-
不同模塊的包名不一致,需要改為在統(tǒng)一包名下controller, service, dao滚停;同理哆窿,也可以將SpringBoot 啟動(dòng)類放到共同的包名的一個(gè)層級(jí)下馋记;
-
4.
- SpringBoot 會(huì)默認(rèn)加載數(shù)據(jù)源相關(guān)信息助赞,單獨(dú)拆分出來(lái)的 web 層不需要與數(shù)據(jù)庫(kù)打交道熬拒,所以需要配置 exclude 屬性:
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
5.
-
Qu: 慎用
ctrl+shift+r
全局替換语御,同時(shí)也注意 IDEA 更改包名同時(shí)也全局替換與包名一致的任意位置屬性峻贮。