gjf66924011 2015-02-09 07:59 采纳率: 0%
浏览 1562

spring无法执行拦截器

直接上代码。
ApplicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">












theAdvice






拦截器类:
package com.gjf.interceptor;

import java.lang.reflect.Method;
import java.util.Arrays;

import org.springframework.aop.MethodBeforeAdvice;

public class MethodBeforeAdviceImpl implements MethodBeforeAdvice{

@Override
public void before(Method m, Object[] args, Object o)
        throws Throwable {
    System.out.println("运行前检查....");
    System.out.println("method:" + m.getName());
    System.out.println("args:" + Arrays.asList(args));
    System.out.println("object:" + o);
}

}

我希望在执行service方法的时候,能够输出拦截器中before方法的内容,但是每次都直接输出service方法的结果?请帮我看看我的配置文件中是否存在问题,在线等。!!

  • 写回答

1条回答 默认 最新

  • X_TIE 2015-02-09 08:44
    关注



    com.web.listener.WebConfigContextListener

      com.web.listener.WebConfigContextListener 这句换成你的路径试试(监听器路径)
    
    评论

报告相同问题?

悬赏问题

  • ¥15 算法题:数的划分,用记忆化DFS做WA求调
  • ¥15 chatglm-6b应用到django项目中,模型加载失败
  • ¥15 武汉岩海低应变分析软件,导数据库里不显示波形图
  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥30 CanMv K210开发板实现功能
  • ¥15 C# datagridview 栏位进度
  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile