好的,我解决了。我需要做的就是在我的班级中插入以下注释
SecurityConfig:
@ComponentScan(value="org.webapp")
现在我可以
DataSource在这堂课中自动接线
@Autowiredprivate DataSource restDataSource;@Autowiredpublic void configure(AuthenticationManagerBuilder auth) throws Exception { auth .jdbcAuthentication() .dataSource(restDataSource) .usersByUsernameQuery(getUserQuery()) .authoritiesByUsernameQuery(getAuthoritiesQuery());}


