今天遇到了一个一开始感觉很莫名其妙的报错

  

  在编写页面的时候把原先写在html页面里的js代码单独拿出来做成一个JavaScriptUtil文件,放在了和html页面同一个目录下。运行之后在对应的页面console报404,挺摸不着头脑的一开始,按住ctrl点击文件也可以正确跳转。(用Ajax做点赞和评论功能)

  睡了一觉忽然想起来!!!服务器没有访问WEB-INF文件的权限!!!

  就这么简单,可恶。


  好吧其实事情并没有我想的那么简单,我的需求是在一些页面用到Ajax和Cookie,那我就要把这些方法提出来做成一个JavaScriptUtil工具文件,随时在各个html页面调用,前端用了Thymeleaf,后端用的是springMVC做视图解析。看了很多文章都没有解决Thymeleaf+SpringMVC读取静态资源的问题。

  https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#server-root-relative-urls

  这个是Thymeleaf的官方文档,在读,解决了再来更新回答over。

  不过上面的回答也是一种可能性啊。

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 (Not Found) favicon.ico文件找不到

    Django项目开发完成后在本地运行没问题,但在推到服务器上后出现报错Failed to load resource: the server responded with a status of 40 ...

  2. jsp中引入jquery报错:Failed to load resource: the server responded with a status of 404 (Not Found)

    问题描述: 今天自己在搭建spring.springMVC.hibernate框架,搭建完成后,在引入jquery时,发现jquery不管用.我的解决顺序是: 1.检查路径,发现路径没错,另外需要注意 ...

  3. 待解决:2bootstrap-cerulean.css Failed to load resource: the server responded with a status of 404 ()

    2bootstrap-cerulean.css Failed to load resource: the server responded with a status of 404 ()

  4. 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) 报错情况:图标加载失败 原因分析:路径错误 ...

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

    出现错误: Failed to load resource: the server responded with a status of 404 () 但是其他页面正常显示: 原因: 浏览器看一下:  ...

  6. ripple Failed to load resource: the server responded with a status of 404 (Not Found)

    在VS2015中使用Cordova + typescript开发中,遇到个问题. 在javascript console 中提示: Failed to load resource: the serve ...

  7. springmvc Failed to load resource: the server responded with a status of 404 (Not Found)

    jsp页面导入css.js提示上述问题. Spring对静态资源的请求做专门处理 <!-- 对静态资源的请求 --><mvc:resources location="/js ...

  8. SSM框架下 Failed to load resource: the server responded with a status of 404 (Not Found)错误

    这个错误提示的是js的引用路径有错: 1.检查应用路径是否正确(我的问题是路径是正确的但是去到页面就会提示404错误) 引用路径,最好都使用绝对路径 <script type="tex ...

  9. Failed to load resource: the server responded with a status of 404 (Not Found) favicon.ico文件找不到

      今天使用sublime以localhost方式打开html文件时(使用wamp环境提供一个Apache服务器,html文件存在于wamp环境的www文件夹下),出现favicon.ico文件找不到 ...

  10. glyphicons-halflings-regular.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)解决Web部署 svg/woff/woff2字体 404错误

    问题:最近在IIS上部署web项目的时候,发现浏览器总是报找不到woff.woff2字体的错误.导致浏览器加载字体报404错误,白白消耗了100-200毫秒的加载时间. 原因:因为服务器IIS不认SV ...

随机推荐

  1. 选择Key-Value Store

    [IT168 专稿]在之前的文章中,给大家介绍了<Redis快速入门:Key-Value存储系统简介>,今天进一步给大家介绍为什么选择Key-Value Store.Key-Value S ...

  2. Vue中图片的加载方式

    一.前言 VUE项目中图片的加载是必须的,那么vue中图片的加载方式有哪些呢,今天博主就抽点时间来为大家大概地捋一捋. 二.图片的加载方法 1.在本地加载图片(静态加载) 图片存放assets文件夹中 ...

  3. babel和polyfill?

    Babel: Babel 是一个广泛使用的 ES6 转码器,可以将 ES6 代码转为 ES5 代码.注意:Babel 默认只转换新的 JavaScript 句法(syntax),而不转换新的 API ...

  4. notify()和 notifyAll()有什么区别?

    当一个线程进入 wait 之后,就必须等其他线程 notify/notifyall,使用 notifyall,可 以唤醒所有处于 wait 状态的线程,使其重新进入锁的争夺队列中,而 notify 只 ...

  5. springboot-@EventListener简单用法

    @EventListener简单描述 简化我们编写监听类的步骤,不需要再继承ApplicationListener接口去实现onApplicationEvent了. 例子: @Component pu ...

  6. memcached 是怎么工作的?

    Memcached 的神奇来自两阶段哈希(two-stage hash).Memcached 就像一 个巨大的.存储了很多<key,value>对的哈希表.通过 key,可以存储或查询任意 ...

  7. 什么是微服务架构中的 DRY?

    DRY 代表不要重复自己.它基本上促进了重用代码的概念.这导致开发和共享库, 这反过来导致紧密耦合.

  8. java中异常这种技术框架是怎么工作的?

    异常这种技术框架是怎么工作的?马克-to-win:注意是运行程序时,而不是编译时,当一个非正常情况出现,比如除0,就叫异常情况.马克-to- win:为了能优雅的处理异常情况(在出现异常情况后,程序不 ...

  9. java中什么是局部内部类Local inner class?

    5.局部内部类Local inner class 马克-to-win:什么叫局部内部类?内部类声明位置:1.它的外部类的范围之内.2.在几个程序块的范围之内.例如,由方法定义的块中或甚至在for循环体 ...

  10. CentOS安装图形界面以及eclipse的安装

    图形界面的安装,以GNOME为例: 1.首先运行命令:yum grouplist 会显示可安装的包,可以自己选择安装. 2.运行  yum gruopinstall "GNOME" ...