得到spring的上下文
WebApplicationContext context1 = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
musicListService = (MusicListService) context1.getBean("musicListService");
songService = (SongService) context1.getBean("songService");
spring的注入
<bean id="songService" class="com.chinaGPS.song.service.impl.SongServiceImpl">
<property name="songDao" ref="songDao" />
<property name="singerDao" ref="singerDao" />
<property name="musicListShipDao" ref="musicListShipDao" />
</bean>