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

  

  在编写页面的时候把原先写在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. VMware Workstation网络修改vlan id值

    我们捣鼓虚拟机时,有时候网卡是需要承载多个vlan的,比如说部署fuel时网卡3需要承载私有,管理,存储网络的流量. 在virtualbox中我们可以直接在混杂模式项选择全部允许,但是在VMware ...

  2. java == 和 equals

  3. XML约束DTD

    <元素1> <元素2> <元素3>描述1</元素3> <元素4>描述2</元素4> </元素2> </元素1& ...

  4. java常见字节大小存储问题

    JAVA中默认的编码方式 转:http://blog.csdn.net/scyatcs/article/details/31356823 编码问题存在两个方面:JVM之内和JVM之外.1.Java文件 ...

  5. Java并发机制(6)--阻塞队列

    Java并发编程:阻塞队列整理自:博客园-海子-http://www.cnblogs.com/dolphin0520/p/3933404.html 1.什么是阻塞队列 除了同步容器(Hashtable ...

  6. jedis 和 redisson 有哪些区别?

    Jedis 和 Redisson 都是Java中对Redis操作的封装.Jedis 只是简单的封装了 Redis 的API库,可以看作是Redis客户端,它的方法和Redis 的命令很类似.Redis ...

  7. 在 java 中守护线程和本地线程区别?

    java 中的线程分为两种:守护线程(Daemon)和用户线程(User). 任何线程都可以设置为守护线程和用户线程,通过方法 Thread.setDaemon(bool on):true 则把该线程 ...

  8. memcached 最大能存储多大的单个 item?

    1MB.如果你的数据大于 1MB,可以考虑在客户端压缩或拆分到多个 key 中. 为什么单个 item 的大小被限制在 1M byte 之内? 简单的回答:因为内存分配器的算法就是这样的. 详细的回答 ...

  9. Thymeleaf集成Shiro,shiro权限使用el表达式

    如果是Thymeleaf集成Shiro的话, 如果使用Shiro在页面上权限字符串需使用thymeleaf的表达式的话, 如果权限字符串在实例级别的话, 可以使用这种方式进行权限字符串的动态实例控制 ...

  10. JVM的基础知识

    一.JVM的基础知识 1.JVM内存结构: 1.JVM堆内存结构: 2.JVM内存分配: 3.Java的堆机构和垃圾回收: 4.Jvm堆内存配置参数: 5.JVM新生代概念和配置: 6.JVM老生代概 ...