Java 包含多个`context:exclude filter`的正确语法是什么?

Java 包含多个`context:exclude filter`的正确语法是什么?,java,spring,spring-mvc,aspectj,Java,Spring,Spring Mvc,Aspectj,插入多个上下文:排除筛选器的正确语法是什么 我正在使用这个,但我不知道它是否有效: <?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:context="http://www.springframewo

插入多个
上下文:排除筛选器的正确语法是什么

我正在使用这个,但我不知道它是否有效:

<?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:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:annotation-config />
    <context:component-scan base-package="com.myapp">
        <context:exclude-filter type="aspectj" expression="com.myapp.components.*"/>
        <context:exclude-filter type="aspectj" expression="com.myapp.batch.*"/>
        <context:exclude-filter type="aspectj" expression="com.myapp.widgets.*"/>
        <context:exclude-filter type="aspectj" expression="com.myapp.tools.*"/>
    </context:component-scan>

    <import resource="applicationContext-data.xml" />
    <import resource="applicationContext-security.xml" />
    <import resource="applicationContext-service.xml" />

</beans>

您可以像以前那样指定多个包含和排除。您还可以使用诸如regex之类的过滤器在一个表达式中捕获多个包。请看一下规范: