Steps to develop spring AOP Application
1) create new maven project.
2) add required
dependencies in POM.xml file
Spring aop jar, aspectjweaver, aspectjrt, context, etc.!
3) create beans configured Java/xml file.
4) write
business logic inside src/main/java
Java Project(primary logic)
Java Project(cross-cutting/seconday logic)
pom.xml
Beans.xml
Output:
Project Folder Structure
Note: spring
beans we can configure in 3 ways
1) xml
based configuration file
Configure <beans> inside beans.xml file
2) annotation-based
configuration
Configure
<context:annotation-config/> inside beans.xml file and use annotations
inside Java class.
3) Java
based configuration
Configurations
happen in Java file without xml file.
with the help of annotations like @configuration, @beans, @component, @service, @controller..etc.!
No comments:
Post a Comment