1. 程式人生 > >springboot中存放靜態資源訪問方法

springboot中存放靜態資源訪問方法

轉自:https://blog.csdn.net/xlecho/article/details/85015508

 

springboot中建立靜態資源,需要訪問最關鍵的只需要建立一個配置類即可

建立springboot工程

建立的時候加入web依賴

工程目錄結構


建立靜態頁面
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WelCom</title>
</head>
<body>
    <h2>Hello World!</h2>
</body>
</html>