Sep 21st, 2012, 12:50 PM
Static field initialization before all other beans
I need set static field of class before any other bean in Spring Context will have initialized. I need it because I create the instances of this class with "new" in beans (that in Spring Context) and I must be sure that the static field is already initialized whenever I get it in any bean.
Sep 27th, 2012, 05:59 AM
Spring can't inject your static field as the @Autowired is not supported for static fields. You'll have to make your field as non-static and may get around it by using @Configurable annotation. But will that solve your problem depends upon your specific problem.