spring ServiceUtil

public class ServiceUtil {

	private static final ApplicationContext appCtx = new ClassPathXmlApplicationContext(
			"META-INF/springbeans.xml");

	public static Object getService(Class t) {
		return  appCtx.getBean(t.getName());
	}
}

 

你可能感兴趣的:(spring,xml)