* 본 내용은 "코드로 배우는 스프링 웹 프로젝트"의 5장 예제 ex04를 학습하면서 요약한 것으로 자세한 사항은 책을 참조 바람
* 나의 개발 환경(향후 Cafe24운영 환경에 맞도록 아래와 같음)
- Tomcat 8.0.x (jsp 2.3/Servlet 3.1) , OpenJDK 8.x , MariaDB 10.1.x
18.1 AOP 개념
- Target
- Proxy
- Advice
- Joint Point
- Point Cut
- Before Advice
- After Return Advice
- After Throwing Advice
- After Advice
- Around Advice
- execution(@execuition)
- within(@within)
- this
- args(@args)
- @annotation
18.2.1 AOP 실습 환경 구성
- Spring 5.0.7 => AspectJ 1.9.0
* Spring 4.3.20 => AspectJ 1.9.0 해도 정상 작동함
18.2.2 서비스 계층 설계
- SampleService, SmapleServiceImpl
18.2.3 Advice 작성
- LogAdvise
18.3 AOP 설정 >> [바로가기]
18.4 AOP 테스트
- SampleServiceImpl, LogAdvice 를 묶어 자동으로 Proxy 객체를 생성함
18.4.1 ages를 이용하여 전달된 파라미터 파악
18.4.2 @AfterThrowing
- 지정된 대상이 예외를 발생한 후에 동작하면서 문제를 찾을 수 있도록 함
18.5 @Around와 ProceedingJoinPoint
'[B] Spring Note' 카테고리의 다른 글
5) security-context.xml 설정하기 (0) | 2018.11.18 |
---|---|
4) servlet-context.xml 를 내 프로젝트에 맞도록 변경하기 (0) | 2018.11.14 |
3) root-context.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |
2) web.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |
1) pom.xml 를 내 프로젝트에 맞게 변경하기 (0) | 2018.11.14 |