偏安zzcoder 2017-08-21 06:11 采纳率: 66.7%
浏览 8394
已结题

Intellij中spring配置文件报错

图片说明
这几天刚从MyEclipse转到Intellij IDEA,我的spring-webmvc-servlet.xml配置文件是没有问题的,项目部署后也可以正常运行,但是我的强迫症让我受不了项目有error和warning,有没有大神可以帮我解决一下这个问题?
详细代码如下:

 <?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="cn.breezefaith"></context:component-scan>
    <mvc:annotation-driven></mvc:annotation-driven>
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/jsp/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
</beans>
  • 写回答

3条回答 默认 最新

  • 鼠晓 领域专家: 后端开发技术领域 2017-08-21 07:26
    关注

    xsi:schemaLocation,,,这句后面加个东西试试,,下面只是代码片段

     xmlns="http://www.springframework.org/schema/beans"
    
     xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-4.0.xsd"
    
    评论

报告相同问题?