标签:blog http io 使用 ar strong 文件 art div
转:http://blog.csdn.net/sdandan/article/details/7911241
————————————————————————————————————————
publicinterface BeanFactory {
String FACTORY_BEAN_PREFIX = "&";
Object getBean(String name);
Object getBean(String name, Class requiredType);
boolean containsBean(String name);
boolean isSingleton(String name);
boolean isPrototype(String name);
boolean isTypeMatch(String name, Class targetType);
Class getType(String name);
String[] getAliases(String name);
}
|
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
|
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
|
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/myApplicationContext.xml</param-value>
</context-param>
|
ApplicationContext
ctx=WebApplicationContextUtils.getWebApplicationContext();
LoginAction action=(LoginAction)ctx.getBean("action");
|
Resource resource = new
FileSystemResource("beans.xml");
BeanFactoryfactory = new
XmlBeanFactory(resource);
|
ClassPathResource resource = new
ClassPathResource("beans.xml");
BeanFactoryfactory = new
XmlBeanFactory(resource);
|
ApplicationContext context = new
ClassPathXmlApplicationContext(new String[]
{"applicationContext.xml", "applicationContext-part2.xml"});
BeanFactory factory = (BeanFactory)
context;
|
标签:blog http io 使用 ar strong 文件 art div
原文地址:http://www.cnblogs.com/kaikailele/p/3959294.html