使用Intellij进行SpringMVC网站开发问题总结

来源:互联网 发布:淘宝上架宝贝教程2017 编辑:程序博客网 时间:2024/06/08 18:30

1. Spring配置文件:元素 "context:component-scan" 的前缀 "context" 未绑定。

   

解决方案:

更改 xsi:schemaLocation,为如下内容

<?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"       xsi:schemaLocation="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.xsd">    <!--指明 controller 所在包,并扫描其中的注解-->    <context:component-scan base-package="com.yinghan.controller"/></beans>


2. pom.xml文件的依赖报错,需要重新下载依赖包

解决方法:

pom.xml文件右击,Maven ——reimport


0 0
原创粉丝点击