我創建了一個自定義的sterotype @Action,Spring已經設法在配置中配置的包掃描中檢測到它。原型範圍的自定義Spring Sterotype註釋?
我想要做的下一步是告訴Spring所有具有@Action的類都應該使用原型而不是Singleton來創建。
我@Action界面如下:
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Action {
}
我試着用@Scope(「原型」)來標記它,但似乎並沒有幫助。
是我想要的可能嗎?
肯特
@Scope現在在Spring 3中開箱即用 – 2010-08-19 21:24:49