DWR

DWR Namespace bean reference

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.2
  • Fix Version/s: 3.0.RC1
  • Component/s: spring
  • Description:
    Hide
    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/
    Show
    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/

Activity

Hide
Jose Noheda added a comment - 27/Feb/08 10:59 AM
Adds a new tag

<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)
Show
Jose Noheda added a comment - 27/Feb/08 10:59 AM Adds a new tag <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)

People

Dates

  • Created:
    26/Feb/08 2:16 AM
    Updated:
    27/Feb/08 10:59 AM
    Resolved:
    27/Feb/08 10:59 AM