package testProject;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
final public class applicationContextUtil {
//把AppicationContext做成单态
private static ApplicationContext ac =null;
private applicationContextUtil(){
}
static {
ac = new ClassPathXmlApplicationContext("spring.xml");
}
public static ApplicationContext getApplicationContext(){
return ac;
}
}