I'm using class that is not called by my @Controller
directly and when I try to use @Autowired
propeprty in that class what is defined as @Service
, property is null
. But @Autowired
with same markup will work inside @Controller
.
Example code:
@Service
public class UsernameValidator implements Validator {
@Autowired private UserDao userDao;
// code here when used, userDao is always null
}