May 2015
Intermediate to advanced
234 pages
4h 18m
English
In this recipe, we will create an aspect class and configure Spring to use it. We will use this aspect class and its configuration code in the following recipes.
Here are the steps for creating an aspect class:
pom.xml:<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.5</version> </dependency>
com.springcookbook.aspect.@Component and @Aspect:@Component
@Aspect
public class Aspect1 {
}@EnableAspectJAutoProxy and your aspects package to @ComponentScanRead now
Unlock full access