我有一個監聽器類中web.xml
這樣的:篩選器或偵聽器無法使用彈簧豆嗎?
<listener>
<listener-class>com.datx.monitoring.model.MonitoringHttpSessionListener</listener-class>
</listener>
而對於這個班,我已經定義了一個bean
這樣的:
<bean id="monitoringHttpSessionListener"
class="com.datx.monitoring.model.MonitoringHttpSessionListener" autowire="byName"/>
但這bean
不能使用其他beans
。每次調用此類時,都會有空屬性。
該課程與其他工作正常的課程完全相同。唯一的區別是,這個類被用作listener
,另一個不是。這是爲什麼?
我認真地想,這個類是'new'ed,並且它根本不涉及'spring'!如果確認,我可能需要修改問題。 –
http://www.techper.net/2011/03/05/springified-servlets-listeners-and-filters/ – nobeh