<aop:declare-parents types-matching="com.fyx.spring6.Performer.perform+" implement-interface="com.fyx.spring6.Contextant" default-impl="com.fyx.spring6.GraciousContextant"/>
default-impl这个属性必须要加吗?有什么用呢
这样引入之后要怎样在main方法中调用contextant呢
我这样
ApplicationContext ctx = new ClassPathXmlApplicationContext("com/fyx/spring6/applicationContext.xml");
Performer fyx = (Performer)ctx.getBean("fyx");
可是fyx没有contextant方法呃......我是照着spring in action做的,上面没有讲怎样调用新加入的接口方法。而且这引入的方法到底在哪个类实现啊,难道是用GraciousContextant中实现的方法??
请大家帮帮我 谢谢
default-impl这个属性必须要加吗?有什么用呢
这样引入之后要怎样在main方法中调用contextant呢
我这样
ApplicationContext ctx = new ClassPathXmlApplicationContext("com/fyx/spring6/applicationContext.xml");
Performer fyx = (Performer)ctx.getBean("fyx");
可是fyx没有contextant方法呃......我是照着spring in action做的,上面没有讲怎样调用新加入的接口方法。而且这引入的方法到底在哪个类实现啊,难道是用GraciousContextant中实现的方法??
请大家帮帮我 谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货