cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CFX Novice <suchitrat...@gmail.com>
Subject Re: Resource injection fails for an AOP scoped proxy bean
Date Thu, 24 Jul 2008 13:18:23 GMT

Even then, I would need access to HttpServletRequest in xyzSessionState which
is now an aop-scoped proxy bean and again resource injection would not work,
isnt it?


ianroberts wrote:
> 
> CFX Novice wrote:
>> Hi,
>> 
>> I have this piece of code in my applicationContext.xml
>> 
>>     <jaxrs:server id="xyzserver" address="/xyzservice/">
>>     <jaxrs:serviceBeans>
>>       <ref bean="xyzservice" />
>>     </jaxrs:serviceBeans>
>>   </jaxrs:server>
>> 
>>   <bean id="xyzservice" class="com.xyz.xyzService" scope="session">
>>           <aop:scoped-proxy/>
>>   </bean> 
>> 
>> Somehow resource injection stopped working as soon as I started using
>> <aop:scoped-proxy/> I need to access the HttpServletRequest object in my
>> service class. Any help would be greatly appreciated
> 
> Rather than session-scoping the service bean, an alternative would be to 
> move the data that needs to be scoped at the session level out into 
> another class and keep your service bean singleton, i.e.:
> 
> <bean id="serviceSessionData" class="com.xyz.xyzSessionState" 
> scope="session">
>    <aop:scoped-proxy/>
> </bean>
> 
> <bean id="xyzservice" class="com.xyz.xyzService">
>    <property name="sessionData" ref="serviceSessionData" />
> </bean>
> 
> Ian
> 
> -- 
> Ian Roberts               | Department of Computer Science
> i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
> 
> 

-- 
View this message in context: http://www.nabble.com/Resource-injection-fails-for-an-AOP-scoped-proxy-bean-tp18631370p18631763.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message