<?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.0.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.0.xsd">
<!-- 注解驅動 -->
<mvc:annotation-driven/>
<context:component-scan base-package="com"/>
<!-- 配置視圖解釋器 -->
<bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前綴 -->
<property name="prefix" value = "/view/"></property>
<!-- 後綴 -->
<property name="suffix" value = ".jsp"></property>
</bean>
</beans>
像上面這樣的 寫我的myeclipse 就會報錯
錯誤是:Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd). For more information, right click on the message in the Problems View and
select "Show Details..."
然後我不以注解驅動的方式 的話就沒錯
就是把下面的刪掉就沒報錯了
mvc:annotation-driven/
問題已經解決是 Namespaces問題 Namespace標簽下的beans 選項裡面的 namespace version 應該選擇的和 spring的版本一致