Can we autowire static fields in spring controller ?
eg:
@Autowired public static JNDIEMailSender jNDIEmailSender;
Spring doesnt autowire static fields
No, I don't think that will work. You can add a setter method, annotate it with @Autowired and set the static field in the setter.
@Autowired void setJNDIEmailSender(JNDIEmailSender jndiEmailSender) { ClassName.jNDIEmailSender = jndiEmailSender }