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
[EMAIL PROTECTED]  | University of Sheffield, UK

Reply via email to