飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

Spring mvc aop to get request and response

时间:2021-12-14  作者:匿名  
@Aspect
public class LoggingAspect {

    
    @Before("execution(* xxxxxxxxxxx(..))")
    public void logBefore(JoinPoint joinPoint) {
    / /此处可以通过以下方法得到REQUEST,另外也可以通过参数方法得
       HttpServletRequest request = ((ServletRequestAttributes) 域名equestAttributes()).getRequest();
 
        域名tln("******"+域名arameter("username"));
        域名tln("******");
        域名tln("******");
        域名tln("******");
        域名tln("logBefore() is running!");
        域名tln("hijacked : " + 域名ignature().getName());
        域名tln("******");
        //Currently, I just use this method to get repines, another way is to use filter to set request and response, then use them in AOP method

        HttpServletResponse response = (HttpServletResponse) 域名rgs()[0];
        
        

    }
 
}
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。