静态页无法加载问题:Failed to load resource: the server responded with a status of 404

静态页无法加载问题:Failed to load resource: the server responded with a status of 404 

这样的问题,通常是由于加载样式页的路径写的有些问题,所以检查,自己的引入路径:

idear下引入web下引用静态资源的目录结构 ,是可以直接获取到的。jsp下引用需要的css 直接在web下就可以直接找到相关的路径,不需要添加绝对路径 。静态页无法加载问题:Failed to load resource: the server responded with a status of 404

正常情况下,可以通过${pageContext.request,contextPath}也一样可以获取到,但在我的jsp中却不可以,这部分仅供参考。

静态页无法加载问题:Failed to load resource: the server responded with a status of 404 在使用${pageContext.request.contextPath}的时候,提示上面的部分:javax.servlet.jsp.PageContext pageContext,可以参考引入下面的包。

在路径问题上${pageContext.request.contextPath}

<!--引入jsp的jar包-->

<dependency>

  <groupId>javax.servlet</groupId>

  <artifactId>javax.servlet-api</artifactId>

  <version>3.0.1</version>

  <scope>provided</scope>

</dependency>

<dependency>

  <groupId>javax.servlet.jsp</groupId>

  <artifactId>jsp-api</artifactId>

  <version>2.2.1-b03</version>

</dependency>