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

  

  在编写页面的时候把原先写在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. HashMap?ConcurrentHashMap?

    Java团长在csdn 2019-02-06 19:58:00  104241  收藏 666     来源:crossoverJie(ID:crossoverJie) 前言 Map 这样的 Key ...

  2. 什么是Java序列化,如何实现Java序列化?或者请解释Serializable接口的作用?

    象序列化的目标是将对象保存到磁盘中,或允许在网络中直接传输对象,对象序列化机制允许把内存中的Java对象转换成平台无关的二进制流,从而允许把这种二进制流持久保存在磁盘上,通过网络将这种二进制流传输到另 ...

  3. vue开发chrome扩展,数据通过storage对象获取

    开发chrome插件时遇到一个问题,那就是单文件组件的data数据需要从chrome提供的storage对象中获取,但是 chrome.storage.sync.get 方法是异步获取数据的,需要通过 ...

  4. 爬虫-数据解析-bs4

    1.数据解析 解析: 根据指定的规则对数据进行提取 作用: 实现聚焦爬虫 数据解析方式: - 正则表达式 - bs4 - xpath 数据解析的通用原理: 数据解析需要作用在页面源码中(一组html标 ...

  5. x64 简介

      本篇原文为 introduction to x64 assembly ,如果有良好的英文基础,可以点击该链接进行下载阅读.本文为我个人:寂静的羽夏(wingsummer) 中文翻译,非机翻,著作权 ...

  6. 设置python 虚拟环境 virtualenv django 虚拟环境

    https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/development_environment Ubuntu vir ...

  7. html5与css交互 API 《一》classList

    用过jquery的朋友都知道,jquery提供的方法中(3个)可以很方便的为指定的节点添加.删除类选择器,即addClass.removeClass.toggleClass.具体的用法我这里就不谈了, ...

  8. 微信小程序黑客马拉松即将开始,来做最酷的 Mini Program Creators!

    微信小程序黑客马拉松正式启动 近日,小程序斩获一项世界级殊荣--作为一项全新的技术和应用创新,小程序首次获选世界互联网领先科技成果.目前小程序应用数量已超过 100 万,覆盖了 200 多个细分行业, ...

  9. CSS揭秘之《多重边框》

    1.box-shadow还接受第四个参数(称作"扩张半径"), 通过指定正值或负值, 可以让投影面积加大或者减小2.如果我们想要一道实线边框其实也是可以通过box-shadow来模 ...

  10. [FireshellCTF2020]ScreenShooter 1

    此题关键在于理清逻辑,本地将url发送给服务器,服务器请求sereenshooter以后将结果返回 所以应该在服务器查看日志. 发现了PhantomJS 引擎一下 <!DOCTYPE html& ...