我们有一个第三方Java Web应用程序,它需要在集群中运行(我们需要在集群中复制会话),该应用程序中的会话属性不可序列化,并且我们不能访问源代码,它们是否干净,非侵入性的方法来拦截session.set属性调用并在将对象放入会话之前更改对象
Seeing HttpSessionAttributeListener
is not a solution that is OK with you, there is the option of using a ServletFilter
. Not sure is that is too intrusive for your requirements, though...
HTTPServletRequest
you're passing down the chain with your own implementation of HttpServletRequestWrapper
, overriding getSession
by returning a decorator implementation of the original container created Session
implementation setAttribute
methods.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.