【发布时间】:2014-06-23 00:34:44
【问题描述】:
我正在使用 Spring-MVC,我需要一种 bean 范围,例如 Conversation Scope。我知道 Spring Web Flow,但我不喜欢它,因为它让我感觉像是用 XML 编程。
所以我想用以下功能实现我自己的对话范围:
- 超时。当指定的时间过去后,这个 cope 应该被自动销毁。
- 我也可以手动销毁这个范围。比如调用
myscope.destroy()方法。
我该如何实现它?
【问题讨论】:
-
问题是?
-
@SergeBallesta 我想自己实现一个对话范围
-
所以你应该:首先阅读 Spring Reference Manual 的相关部分,然后在 spring custom scope tutorial 上阅读第二个 google。我做的第一个答案是来自 JavaBeat 的Custom Scope for Spring Beans 似乎与您的问题有关。
标签: spring spring-mvc servlets