等同于< aop:scoped-proxy>的注释 [英] annotation equivalent of <aop:scoped-proxy>

查看:148
本文介绍了等同于< aop:scoped-proxy>的注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从xml配置转移到注释.我想转换为

I am moving from an xml config to annoations. i want to convert a session scoped bean that is

<aop:scoped-proxy>

这可以通过注释来完成吗?如果没有,我该怎么做才能使该声明继续起作用?

can this be done with annotations, and if not, what can i do to still keep that declaration working?

修改: 我对在Spring 2.5中进行此操作很感兴趣

edit: I am interested in doing this in Spring 2.5

推荐答案

在spring上下文xml中,执行以下操作:

in the spring context xml, do something like:

<context:component-scan base-package="com.startup.failure" scoped-proxy="interfaces" />

请注意,尽管如此,您需要为该程序包中的所有类编写接口.

Note that you would need to write interfaces for all classes in that package, though.

这篇关于等同于&lt; aop:scoped-proxy&gt;的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆