방금 AspectJ를 배우기 시작했고, 사용자 로그인에 유스 케이스가있다. 사용자의 세션 데이터 (쿠키)가 서버의 저장된 데이터와 일치하지 않으면 호출 된 함수를 변경하려고합니다.AspectJ에서 제어 흐름을 변경하라는 조언
class HttpServlet {
public function() {
}
public function2() {
}
public doLogin() {
}
}
과 내가 같은 조언이 있습니다 : 그래서 어떻게해야합니까 redirectToDoLoginAndAbortCalledFunction() 작동
public aspect UserLoggedIn {
pointcut GreetingServer(): within(HttpServlet);
pointcut requireAuth():
GreetingServer() && execution(* function*(..));
before(): requireAuth() {
if (notLoggedIn) {
redirectToDoLoginAndAbortCalledFunction();
}
}
}
나는이 작업을 말해봐?
특별한 이유가 없습니다. 저는 AspectJ를 배우려고 노력하고 있고 다른 방법으로 평소에 할 일을하려고 노력하고 있습니다. –