logafteradvice.java

来自「这个是j2eejava web 编程精要十五讲的全部源码。对学习java web」· Java 代码 · 共 18 行

JAVA
18
字号
package test;

import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.aop.AfterReturningAdvice;

public class LogAfterAdvice 
        implements AfterReturningAdvice { 
    private Logger logger = 
            Logger.getLogger(this.getClass().getName()); 
    
    public void afterReturning(Object object,Method method, Object[] args, 
                     Object target) throws Throwable { 
        logger.log(Level.INFO, 
                "method ends..." + method); 
   } 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?