WeatherService ws = (WeatherService) ctx.getBean("weatherService");
或
Map allWeatherServices = ctx.getBeansOfType(WeatherService.class);
WeatherService ws = (WeatherService) ctx.getBean("weatherService");
或
Map allWeatherServices = ctx.getBeansOfType(WeatherService.class);