Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Architecture & Framework
» Spring Framework
打印话题 寄给朋友 订阅主题 |
作者 | Re:[求助][急]如何将活动的servlet 注入 bean里 [Re:cliff] |
cliff
发贴: 11 积分: 0 |
于 2006-10-30 14:33
About autoproxing BeanNameAutoProxyCreator, I have a related question: As you know, in order to take the second approach, I need to apply more than one interceptor to different targets(action methods). Let me explain it with a example: There are two interceptors, InterceptorA and InterceptorB and two targets, TargetA and targetB, I want to use autoproxing BeanNameAutoProxyCreator to apply InterceptorA to TargetA and InterceptorB to TargetB, in applicationContext.xml, if I do it this way:
when I try to run it, the exception org.springframework.beans.factory.BeanNotOfRequiredTypeException would be threw out, I find that it's because I define BeanNameAutoProxyCreator twice , and I use different bean name(autoProxyA,autoProxyB). Even if I add the attribute "singleton="false"", it still doesn't work. But if I define BeanNameAutoProxyCreator only once, I don't konw how to make sure InterceptorA only be applied to TargetA, and InterceptorB only be applied to TargetB. So what do you think about this problem: how do we use "BeanNameAutoProxyCreator" to apply different interceptors to different targets?
cliff edited on 2006-10-30 14:38
JBuilder使用技巧 |
话题树型展开 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |