標籤:pac 錯誤 ase for sch ann pack ati 找不到
<?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/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
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven />
<context:component-scan base-package="com.exyong" />
</beans>
注意配置中的拼字錯誤,我在配置的時候 <beans xmlns 漏了個s (xmln)導致一直報 “cvc-elt.1: 找不到元素 ‘beans‘ 的聲明”
注意 <mvc:annotation-driven />配置的base-package 的值為放置Controller的包名,否則報 “No mapping found for HTTP request with URI“
spring-mvc xml檔案的最基本配置