zoukankan      html  css  js  c++  java
  • 【SpringMVC】运行流程

    SpringMVC 运行流程

    在 Spring 的环境下使用 SpringMVC

    Bean 被创建两次 ? • Spring 的 IOC 容器不应该扫描 SpringMVC 中的 bean, 对应的 SpringMVC 的 IOC 容器不应该扫描 Spring 中的 bean

    <context:component-scan base-package="com.nemo.springmvc">
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.ControllerAdvice"/>
    </context:component-scan>
    <context:component-scan base-package="com.nemo.springmvc" use-default-filters="false">
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.ControllerAdvice"/>
    </context:component-scan>

    在 Spring MVC 配置文件中引用业务层的 Bean

    • 多个 Spring IOC 容器之间可以设置为父子关系,以实现良好的解耦。
    • Spring MVC WEB 层容器可作为 “业务层” Spring 容器的子容器:即 WEB 层容器可以引用业务层容器的 Bean,而业务层容器却访问不到 WEB 层容器的 Bean

  • 相关阅读:
    KnockoutJS(2)-监控属性
    KnockoutJS(1)-数据模型
    Stimulsoft Reports报表工具
    Knockout.js 初探
    web网页的表单排版利器--960css
    用一个div模拟textarea的实现
    正则表达式笔记4-封装class
    正则表达式笔记3
    正则表达式笔记2
    正则表达式笔记1
  • 原文地址:https://www.cnblogs.com/blknemo/p/13498279.html
Copyright © 2011-2022 走看看