在启动springboot加载首页时,出现如下截图的报错:

出现这种报错,是因为静态资源的引入路径不正确,不能写成下面的路径:

<link rel="stylesheet" type="text/css" href="../static/css/bootstrap.min.css">

而应该写成:

 <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">

这是因为springboot对于静态资源的默认访问路径配置决定的,下面是springboot中关于静态资源访问配置的源码:

@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
public class ResourceProperties {private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { "classpath:/META-INF/resources/","classpath:/resources/", "classpath:/static/", "classpath:/public/" };/*** Locations of static resources. Defaults to classpath:[/META-INF/resources/,* /resources/, /static/, /public/].*/private String[] staticLocations = CLASSPATH_RESOURCE_LOCATIONS;

我们可以看到,这些目录都是默认配置的,无需我们在添加。

manul_css.css:1 Failed to load resource: the server responded with a status of 404 ()相关推荐

  1. Failed to load resource: the server responded with a status of 404 ()

    问题: Failed to load resource: the server responded with a status of 404 ()  在SpringMVC中,你可能会遇到访问页面的时候 ...

  2. Springboot 页面访问不到静态资源Failed to load resource: the server responded with a status of 404 ()

    Springboot 页面访问不到静态资源 问题:在HTML文件中引入图片,但是浏览器访问不到图片. index.html: <!DOCTYPE html> <html xmlns: ...

  3. 浏览器控制台显示 Failed to load resource: the server responded with a status of 404 ()

    今天做项目时,前端资源可以正常打开,但是使用SpringBoot启动时,前端控制台却显示浏览器控制台显示 Failed to load resource: the server responded w ...

  4. Failed to load resource: the server responded with a status of 404 (Not Found) iml文件配置错误

    运行报错: Failed to load resource: the server responded with a status of 404 (Not Found) 原因: 发现是iml文件配置错 ...

  5. Failed to load resource: the server responded with a status of 404 (Not Found)啥意思

    Failed to load resource: the server responded with a status of 404 (Not Found)这个错误表示,服务器无法找到您请求的资源.具 ...

  6. 无法加载静态的图片Failed to load resource: the server responded with a status of 404 (Not Found)

    想到的解决办法的思路是 1,是否是路径的错误 2,是否在resource中定义了静态资源加载(最好是在webapp下独立创建一个放静态资源的文件) 检查发现是路径的错误,可是为什么会出现路径的错误呢 ...

  7. Failed to load resource: the server responded with a status of 404

    搞来搞去附件下载请求的地址老包404,我用的easyui1.5   引用下载插件 <script type="text/javascript" src="${ctx ...

  8. Failed to load resource:the server responded with a status of 404()

    jsp页面: 原因: 声明文档的解析类型(document.compatMode),避免浏览器的怪异模式.document.compatMode: BackCompat:怪异模式,浏览器使用自己的怪异 ...

  9. Vue3报错之 Failed to load resource: the server responded with a status of 404 (Not Found)

    不知道为什么,重新建立了src组件之后,之前组件运行npm run dev的localhost地址没办法打开新的组件,只能在新的组件里面重新右键在集成终端中打开运行npm run dev,反正问题是解 ...

  10. vue前台Failed to load resource: the server responded with a status of 404 (Not Foun

    可能是代理网络的问题,有时候报错但是页面正常 npm install --no-fund npm run dev

最新文章

  1. 亮度翻转_ROG幻13翻转本发布;联想IdeaPad 5G轻薄本即将上线
  2. java ajax post_2、Ajax与Java通过POST方式交互
  3. MyBatis子查询
  4. 空净厂商为何对“9颗星”认证趋之若鹜?
  5. mysql md5版本校验_通过MD5校验和验证MySQL软件包的完整性
  6. Unknown custom element: xxx
  7. Android中使用官方提供好的功能使用说明(比如系统图库获取),也作为延生学习的学习文档
  8. MiniGUI编程--列表框
  9. PHP7 pecl 安装 mongodb扩展 和 PHPLIB
  10. 利用计算机提出算法分析问题,应用计算机计算不可积类型的积分算法分析
  11. 【转】灵活运用 SQL SERVER FOR XML PATH
  12. 18.看板方法---精益的一种经济学模型
  13. linux 怎么添加文件类型,如何在Linux/Unix上添加基于文件类型的文件扩展名?
  14. 华为数通VRRP配置实验
  15. 《视觉SLAM十四讲》-第五章第1节-1-“相机与图像”-“相机模型”-“针孔相机模型”-学习笔记总结
  16. 搜索引擎优化系统知名乐云seo_北京网络优化知名乐云seo
  17. MongoDB 语法大全
  18. 教你用安卓手机以及在Linux下连接校园联通无线宽带
  19. Python 负载均衡,数据轮询 hash字符串 hashlib
  20. 工信部下架96款侵害用户权益App、通报3款违规SDK

热门文章

  1. 供应链三道防线(读书笔记)3(共4)
  2. java单点登录解决方案_N多系统单点登录,实现、解决方案。四种解决方案
  3. 关于机器人创业:学术界vs工业界及中国机器人企业的机会
  4. Xsens MVN Analyze高精度惯性动作捕捉系统Link版
  5. 如何设计一个网页版音乐播放器
  6. 苹果台式电脑怎么使用计算机,苹果笔记本键盘怎么用_苹果笔记本电脑键盘的使用方法-win7之家...
  7. 1.为什么要使用token,token是什么?
  8. 【MyBatis笔记-09】MyBatis-Plus的使用
  9. 一周小结(2019/12/23)
  10. 非常量引用的初始值必须是左值的处理方法