JSP无法加载静态资源:Failed to load resource: the server responded with a status of 404 ()

最近在用前端框架做javaweb开发的时候,总是遇到静态资源无法正常加载的bug,问题如下图


JSP无法加载静态资源:Failed to load resource: the server responded with a status of 404 ()_第1张图片
bug

原因是在经过servletDispatcher转发时被它内置的过滤器给拦截了,引入文件是这样的


问题源

解决方法:

1、在jsp页面,引入C标签库

 也就是加入这个语句<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

2、用 标签引入框架文件

如下图


JSP无法加载静态资源:Failed to load resource: the server responded with a status of 404 ()_第2张图片
解决方法

再次运行程序便可如你所愿!

你可能感兴趣的:(JSP无法加载静态资源:Failed to load resource: the server responded with a status of 404 ())