获取applicationContext的几个类

1, ApplicationContext ac = new FileSystemXmlApplicationContex("src/ applicationContext.xml"); //

2, WebApplicationContext ctx = null;
    if (ctx == null)
    {
    ctx = WebApplicationContextUtils
    .getRequiredWebApplicationContext(this.getServletContext());
   
    }

3, ApplicationContext ac = new ... ClassPathXmlApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");

4, WebApplicationContext wac = (WebApplicationContext)servletContext.

  getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

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