设置的css,js文件以及对应的图片在网页中无法加载
login.jsp
<head>
<title>登录</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<script type="text/javascript" src="js/login.js" charset="UTF-8"></script>
</head>
springmvc.xml
<?xml version="1.0" encoding="UTF-8"?>
<bean xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--自动扫描的包名-->
<!--开始注解-->
<context:annotation-config/>
<context:component-scan base-package="com.whut.controller"/>
</context:component-scan>
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<!-- 开启SpringMVC框架注解的支持 -->
<mvc:annotation-driven/>
<mvc:default-servlet-handler/>
<mvc:annotation-driven></mvc:annotation-driven>
<!--location元素表示webapp目录下 **包下的所有文件,mapping元素表示以/static开头的所有请求路径-->
<mvc:resources mapping="/images/**" location="/images/"></mvc:resources>
<mvc:resources mapping="/css/**" location="/css/"></mvc:resources>
<mvc:resources mapping="/js/**" location="/js/"></mvc:resources>
<!--视图解析器 -->
<bean id="jspviewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp"></property>
</bean>
</bean>
看一下你的web.xml是不是对js,css进行过滤处理了。
静态资源没有放行,访问不了。