XML Schema Based AOP with Spring:-
In this chapter we will see that Implementation of AOP based on XML Schema.
Before using the AOP we have to add namespaces of AOP to the configuration file
as following.
To use the aop namespace tags described in this section, you need to import the
spring-aop schema as described below:
<?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:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">
<!-- Bean definition & AOP specific configuration --> </beans>
Within your Spring configurations, all aspect and advisor elements must be
placed within an <aop:config> element (you can have more than one <aop:config>
element in an application context configuration). An <aop:config>
element can contain pointcut, advisor, and aspect elements .
You will also need following AspectJ libraries on the CLASSPATH of
your application. These libraries are available in the 'lib' directory of an
AspectJ installation, otherwise you can download them from the internet.
1. aspectjrt.jar
2. aspectjweaver.jar
3. aspectj.jar