Hi,
The current namespace Spring integration does not play nicely with multi-modular projects where service bean definitions might reside in a different file which can not be modified.
Can you please look at adding an extra attribute to the dwr:remote tag (eg. bean-ref) which allows the bean id to be passed in, thus allowing the dwr:remote tag to reside in a separate file. eg.
(applicationContext-services.xml)
<bean id="simpleService" class="nz.co.curlybrackets.tutorial.newspringmvc.services.SimpleServiceImpl">
<property name="simpleRepository" ref="aSimpleRepository"/>
<property name="emailService" ref="anEmailService"/>
<property name="importantThing" ref="anImportantThing"/>
</bean>
(applicationContext-dwr.xml)
<dwr:remote bean-ref="myServiceBean" javascript="myAjaxService">
<dwr:include method="*"/>
</dwr:remote>
Currently I acheive this by using Spring proxies eg.
<bean id="mySimpleService" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" value="nz.co.curlybrackets.tutorial.services.SimpleService"/>
<property name="target" ref="simpleService"/>
<dwr:remote javascript="MySimpleAjaxService" />
</bean>
This would also reduce pollution of bean definitions and promote separation of concerns.
Thanks
http://developingdeveloper.wordpress.com/2008/02/16/spring-dwr-namespaces-aop/
<bean id="oneBean" class="..." />
<dwr:proxy-ref bean="oneBean" javascript="...">
<dwr:include method="..." /> // Or exclude
</dwr:proxy-ref>
It allows the namespace handler to remote a bean outside the bean definition, even in other context, as long as the context is reachable (in a parent-child hierarchy)