当前位置: 代码迷 >> Web前端 >> Spring Web 施用之Web ApplicationContext体系结构
  详细解决方案

Spring Web 施用之Web ApplicationContext体系结构

热度:391   发布时间:2012-06-30 17:20:12.0
Spring Web 应用之Web ApplicationContext体系结构

Spring web的应用为XmlWebApplicationContext,它的主要功能是适应Web应用,如国际化资源加载,配置资源的读取,事件等。在其内部还才真正包含了一个核心的BeanFactory,可以说有闭月羞花之容,倾国倾城之貌。总之解释为“金屋藏娇”

Java代码??收藏代码
  1. public?abstract?class?AbstractRefreshableApplicationContext?extends?AbstractApplicationContext?{??
  2. //属性...??
  3. //其他方法...??
  4. /**?
  5. ?????*?为上下文创建一个内部BeanFactory工厂?
  6. ?????*?Create?an?internal?bean?factory?for?this?context.?
  7. ?????*?Called?for?each?{@link?#refresh()}?attempt.?
  8. ?????*?<p>The?default?implementation?creates?a?
  9. ?????*?{@link?org.springframework.beans.factory.support.DefaultListableBeanFactory}?
  10. ?????*?with?the?{@link?#getInternalParentBeanFactory()?internal?bean?factory}?of?this?
  11. ?????*?context's?parent?as?parent?bean?factory.?Can?be?overridden?in?subclasses,?
  12. ?????*?for?example?to?customize?DefaultListableBeanFactory's?settings.?
  13. ?????*?@return?the?bean?factory?for?this?context?
  14. ?????*?@see?org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowBeanDefinitionOverriding?
  15. ?????*?@see?org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowEagerClassLoading?
  16. ?????*?@see?org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowCircularReferences?
  17. ?????*?@see?org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowRawInjectionDespiteWrapping?
  18. ?????*/??
  19. ????protected?DefaultListableBeanFactory?createBeanFactory()?{??
  20. ????????return?new?DefaultListableBeanFactory(getInternalParentBeanFactory());??
  21. ????}??
  22. //其他方法...??
  23. }??

?DefaultListableBeanFactory 现在目睹阿娇之倾国倾城之容:

  相关解决方案