这个小编搞了三个小时,ssm效果在src里是没有报错的现象,但是启动的时候target里的mvc.xml和web.xml里都显示报错,要知道target是启动的缓存,他报错就代表程序无法正常运行,小编的页面css,js都无法加载出来,显示404。
报错图
WEB控制台显示 net::ERR_ABORTED 404。在springMVC里添加
解决方案:
<?xml version="1.0" encoding="UTF-8"?>
<beans 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/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<mvc:annotation-driven enable-matrix-variables="true"></mvc:annotation-driven>
<context:component-scan base-package="dt2008"></context:component-scan>
<mvc:default-servlet-handler/>
希望这边文章对您有帮助
文章评论