Possible Duplicate:
How to make spring inject value into a static field
I have below code
public class CustomerService {
private static CustomerDAO customerDao;
public static void getAllCustomers()
{
customerDao.getAllCustomers();// here i want
}
public static CustomerDAO getCustomerDao() {
return customerDao;
}
public static void setCustomerDao(CustomerDAO customerDao) {
CustomerService.customerDao = customerDao;
}
}
now i am calling CustomerService.getAllCustomers() from my Action object where getAllCustomers is class level method. I want customerDao to be injected by spring in class CustomerService so that when i call getAllCustomers dependency is available ?
I am using spring decalarative dependency injection