spingboot项目打开访问html页面

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/taiguolaotu/article/details/102550694

今天新建一个springboot项目,进行访问html页面时,遇到了一个大坑,无论如何都加载不出来页面。

下面为大家说一下解决原因:
这里我创建的html页面是upload.html,切记一定要放在static文件夹下,而springboot项目下没有自带该文件夹,这时候我们需要在resources文件夹下创建static文件夹,继续创建pageOne文件夹,再将upload.html放入pageOne文件夹下即可。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="order by dede58.com"/>
    <title>无标题文档</title>
</head>
<body>
<form method="post" action="" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" value="上传">
</form>
</body>

在这里插入图片描述
输入访问网址http:localhost:8802/zmj/pageOne/upload.html
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/taiguolaotu/article/details/102550694
今日推荐