Have you tried to use ServletContextAttributeExporter in xml configuration file?
<bean
class="org.springframework.web.context.support.ServletContextAttributeExporter">
<property name="attributes">
<map>
<entry key="<bean key here>">
<ref bean="<bean name here" />
</entry>
</map>
</property>
</bean>