Hello All,

I have a utility class that has all static methods and is using a static instance of LdapTemplate.

So for initializing this class I had created a method setter defined in the bean xml definition as:

public void setContextSource(ContextSource contextSource) {
ldapTemplate = new LdapTemplate(contextSource);
}


I would like to know:

a. Is there any issue in initializing the static instance of LdapTemplate class in this way and using it in the static methods of the class. ( In particular is there any issue in using static instance of ldapTemplate?)

b. How do we initialize static instances in spring bean configurations? Is there any generic way ( Most configurations I see are either constructor init or setters for instance variables )

Thanks for the info!,
Kitty