I defined a class for loading context to use from web services. I doubt whether it is correct or not. Within web service I call it like: SpringUtil.getBean("xxxx").methodXXX();
public class SpringUtil {
static ApplicationContext springContext = null;
public static ApplicationContext getContext() {
if (springContext == null)
springContext = new ClassPathXmlApplicationContext("beans.xml");
return springContext;
}
public static Object getBean(String beanName) {
return getContext().getBean(beanName);
}
}


Reply With Quote
