本文會持續不定時更新
1.配置靜態資源路徑
spring.resources.static-locations=classpath:/templates/,classpath:/static/
2.返回的視圖名不能與訪問路徑相同
@RequestMapping("index")
public String hello(){
return "/index.html";
}
注:當訪問 http://ip:port/index 時,將會產生異常,不能正常訪問到index.html頁面