springboot如何设置访问HTML页面

gggg Boot中设置访问HTML页面。

1. 创建HTML页面

aindexl的文件,代码如下:

“`l> l> head> g Boot HTML< /title> /head> body> g Boot!< /h1> /body> l>

2. 添加依赖

l文件中添加以下依赖:

“`dency> gframework.boot< /groupId> geleaf< /artifactId> dency>

geleaf模板引擎。

troller

aintroller的类,代码如下:

“`portgframeworktroller; portgframeworkdnotationg;

trollertroller {

g(“/”)gdex() { dex”;

trollergdexl页面。

4. 运行应用程序

现在我们可以运行应用程序了。在命令行中运行以下命令:

“`vng

g Boot!”的消息。

geleaftroller并运行应用程序即可。