你需要在
<bean id="loginManager" class="com.sunkai.managerImpl.LoginManagerImpl">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean> </beans>
里配置
jdbcTemplate
才会得到的
<bean id="loginManager" class="com.sunkai.managerImpl.LoginManagerImpl">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean> </beans>
里配置
jdbcTemplate
才会得到的
public final void setJdbcTemplate(JdbcTemplate jdbcTemplate)
Set the JdbcTemplate for this DAO explicitly, as an alternative to specifying a DataSource.
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="loginManager" class="com.sunkai.managerImpl.LoginManagerImpl">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate" />
</property>
</bean>
改成这样还是无效呀?
或者datasource配置不对?
将bean改为local看看
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>