有了@Configuration,原来的springBean的配置文件可以去掉了,
原来在application.xml中配置的bean可以配置在@Configuration注解的来类中,使用@Bean,
@Bean方法名没有意义,返回的对象类型才有意义。
!!!!有@Configuration注解的类会在spring启动时执行一次,里面的bean在其他类中可以@resource注入进来!!!!
----------------------------------直接注入---------------------------------
private static String httpUrl;
@Autowired
public void setHttpUrl(@Value("${httpUrl}") String httpUrl) {
WebSocket.httpUrl = httpUrl;
}