Skip to content

Commit 13c2134

Browse files
committed
@EnableAspectJAutoProxy: per application context, requires aspectjweaver
Issue: SPR-14753 Issue: SPR-15801 (cherry picked from commit 0e734d8)
1 parent ce94026 commit 13c2134

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spring-context/src/main/java/org/springframework/context/annotation/EnableAspectJAutoProxy.java

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,8 +77,8 @@
7777
* // ...
7878
* }</pre>
7979
*
80-
* <p>Note that {@code @Aspect} beans may be component-scanned like any other. Simply
81-
* mark the aspect with both {@code @Aspect} and {@code @Component}:
80+
* <p>Note that {@code @Aspect} beans may be component-scanned like any other.
81+
* Simply mark the aspect with both {@code @Aspect} and {@code @Component}:
8282
*
8383
* <pre class="code">
8484
* package com.foo;
@@ -101,6 +101,16 @@
101101
* // no explicit &#064Bean definitions required
102102
* }</pre>
103103
*
104+
* <b>Note: {@code @EnableAspectJAutoProxy} applies to its local application context only,
105+
* allowing for selective proxying of beans at different levels.</b> Please redeclare
106+
* {@code @EnableAspectJAutoProxy} in each individual context, e.g. the common root web
107+
* application context and any separate {@code DispatcherServlet} application contexts,
108+
* if you need to apply its behavior at multiple levels.
109+
*
110+
* <p>This feature requires the presence of {@code aspectjweaver} on the classpath.
111+
* While that dependency is optional for {@code spring-aop} in general, it is required
112+
* for {@code @EnableAspectJAutoProxy} and its underlying facilities.
113+
*
104114
* @author Chris Beams
105115
* @author Juergen Hoeller
106116
* @since 3.1

0 commit comments

Comments
 (0)