On Fri, 2011-05-27 at 09:00 -0400, Dave Newton wrote: > On Friday, May 27, 2011, Miguel wrote: > > Following my previous email and agreeing with you on this, I might, of > > course, get off the request hook by changing the request injection with > > injecting, for example, those two properties (username and ipaddress) to > > this class, but the underlying problem is the same: I'm not seeing how I > > can inject that requests' username and IP address to that class... > > I'd probably keep a session-scoped bean containing the desired > properties and inject that into the Hibernate interceptor. Spring > understands session-scoped beans; fill the bean on login, etc. >
I never used session-scoped beans, would you mind shedding some light on this please? The link http://struts.apache.org/2.2.3/docs/spring-session-components-workarounds.html in http://struts.apache.org/2.2.3/docs/spring-plugin.html (To use session-scoped components with Spring and Struts, see...) leads to an empty page. What session are we referring to, the http session? > I guess I thought that Hibernate interceptors were normally > singletons, but maybe not. > I believe they can have any scope. In this case they need to be prototype exactly due to the fact that they need the user's details and the list of changes he's making. Miguel