PDA

View Full Version : DWR and session Beans


hconrad
May 4th, 2008, 10:24 PM
Hey Guys,

If this has been covered I must be asking the wrong question so here it goes.

I'm using DWR to set detailed user information in a User object that is session scoped. There are subsequent beans that get the User object injected. DWR appears to be setup correctly as I can set the data with a DWR call. The Problem I'm having is that when other beans try to access the User object it remains null as if the DWR call never happened. I maybe missing something simple but any guidance any if you might have would be greatly appreciated.

Here some more info.
in my web.xml I have the DispatcherServlet and RequestContextListener defined. In my ApplicationContext xml I have <aop:aspectj-autoproxy proxy-target-class="false" /> defined and my bean definition looks as follows.

<bean id="user" class="com.acxiom.barclay.testDatabase.base.User" scope="session" init-method="beingCreated" destroy-method="beingDestroyed">
<aop:scoped-proxy />
</bean>

Any information any of you might have would be very much appreciated.

hconrad
May 5th, 2008, 01:09 AM
I forgot to mention that I'm also using Spring Security. So I think I have come to the conclusion (please correct me if I'm wrong), that since I'm trying to set values int he User Object before I'm authenticated, that by the time I"m authenticated a different session was started and hence I receive a new User Object? Sounds feasible but I'm still studying up on this. If anybody could confirm this I would appreciate it.