我在我的classpath中擁有Spring 3框架中的所有jar,並且我想將Spring 3 mvc添加到我的應用配置中。最初,我有以下的XML。使用Spring 3的問題MVC
<?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:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
<context:annotation-config/>
<bean class="com.apppackage.app.config.AppContextConfig" />
<!-- Autoscan for @Controller type controllers -->
<context:component-scan base-package="com.apppackage.app.controller" />
這只是相關信息的一小部分。我的應用程序工作正常與上面的XML,但後來我加了彈簧3 MVC中的配置有以下變化:
<?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:util="http://www.springframework.org/schema/util"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:annotation-config/>
<mvc:annotation-driven />
<bean class="com.apppackage.app.config.AppContextConfig" />
<!-- Autoscan for @Controller type controllers -->
<context:component-scan base-package="com.apppackage.app.controller" />
現在,我的問題都在我的應用程序。春天似乎不是以前的Autowiring bean。我還收到以下錯誤在我的控制器:
No adapter for handler [[email protected]]: Does your handler implement a supported interface like Controller?
是什麼意思「不能連接最多的資源」? – axtavt 2010-11-15 18:21:18
對不起,我更新了該聲明。希望現在很清楚。 – stevebot 2010-11-15 18:27:57
錯誤提到'LoginController'。所以告訴我們'LoginController'。 – skaffman 2010-11-15 18:40:55