spring之跨模块引用配置文件

Posted 星瑞的随笔

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring之跨模块引用配置文件相关的知识,希望对你有一定的参考价值。

1、导入包或加入依赖关系

2、引入spring配置文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-4.3.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">

    <context:component-scan base-package="catf.component.http">
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/>
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
    </context:component-scan>

    <!--导入校验模块配置-->
    <import resource="classpath*:catf/component/check/res/spring/catf-component-check-context.xml"/>
</beans>

 

以上是关于spring之跨模块引用配置文件的主要内容,如果未能解决你的问题,请参考以下文章

Spring之跨重定向请求传递数据

Spring BootSpring Boot之跨域解决方案

Spring之跨重定向请求传递数据

Spring Boot gradle 多模块项目未解决的引用错误

如何在手动获取spring中的bean(Spring ApplicationContextAware获取上下文)

spring +spring+ hibernate配置1