dwr.xml vs spring configuration and interfaces

View: New views
4 Messages — Rating Filter:   Alert me  

dwr.xml vs spring configuration and interfaces

by Shawn Zeller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello -

I'm converting a project at work from DWR 1.1 to DWR 2.0.5 and there is an odd inconsistency.  I started with changing the project to use the DwrController instead of the servlet while still using the dwr.xml  All of that worked fine.  However, I'll have a section in the dwr.xml that will be something like this:

    <create creator="spring" javascript="addressAjaxService">
      <param name="beanName" value="addressAjaxService"/>
      <param name="class" value="com.foo.AddressAjaxService"/>
    </create>

where the bean is declared like this:

  <bean id="addressAjaxService" class="com.foo.AddressAjaxServiceImpl" />

When I use the dwr.xml, the test page shows just the methods that are in AddressAjaxService.  I could use the spring tags intead like this:

    <dwr:create javascript="addressAjaxService" type="spring">
      <dwr:param name="beanName" value="addressAjaxService"/>
    </dwr:create>

However, this gives me all of the methods from the Impl class.  I tried various permutations of the tags, but I was unable to get the same behavior.  Is there an easy way of doing this just using DWR?  I know that I could manually include/exclude methods, but that would slightly defeat the purpose of using the interfaces in the first place.  Thanks.

- Shawn

Re: dwr.xml vs spring configuration and interfaces

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have you tried dwr:remote better?

Regards

On Sat, Oct 17, 2009 at 2:10 AM, Shawn Zeller <sazeller@...> wrote:
Hello -

I'm converting a project at work from DWR 1.1 to DWR 2.0.5 and there is an odd inconsistency.  I started with changing the project to use the DwrController instead of the servlet while still using the dwr.xml  All of that worked fine.  However, I'll have a section in the dwr.xml that will be something like this:

    <create creator="spring" javascript="addressAjaxService">
      <param name="beanName" value="addressAjaxService"/>
      <param name="class" value="com.foo.AddressAjaxService"/>
    </create>

where the bean is declared like this:

  <bean id="addressAjaxService" class="com.foo.AddressAjaxServiceImpl" />

When I use the dwr.xml, the test page shows just the methods that are in AddressAjaxService.  I could use the spring tags intead like this:

    <dwr:create javascript="addressAjaxService" type="spring">
      <dwr:param name="beanName" value="addressAjaxService"/>
    </dwr:create>

However, this gives me all of the methods from the Impl class.  I tried various permutations of the tags, but I was unable to get the same behavior.  Is there an easy way of doing this just using DWR?  I know that I could manually include/exclude methods, but that would slightly defeat the purpose of using the interfaces in the first place.  Thanks.

- Shawn


Re: dwr.xml vs spring configuration and interfaces

by Shawn Zeller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> Have you tried dwr:remote better?

I started down that route but the way we have the spring config files divided up, it made more sense to do it with dwr:create.  My initial assumption is that it would probably map pretty cleanly to the dwr.xml, which it does, except for this one issue.

On Fri, Oct 16, 2009 at 5:10 PM, Shawn Zeller <sazeller@...> wrote:
Hello -

I'm converting a project at work from DWR 1.1 to DWR 2.0.5 and there is an odd inconsistency.  I started with changing the project to use the DwrController instead of the servlet while still using the dwr.xml  All of that worked fine.  However, I'll have a section in the dwr.xml that will be something like this:

    <create creator="spring" javascript="addressAjaxService">
      <param name="beanName" value="addressAjaxService"/>
      <param name="class" value="com.foo.AddressAjaxService"/>
    </create>

where the bean is declared like this:

  <bean id="addressAjaxService" class="com.foo.AddressAjaxServiceImpl" />

When I use the dwr.xml, the test page shows just the methods that are in AddressAjaxService.  I could use the spring tags intead like this:

    <dwr:create javascript="addressAjaxService" type="spring">
      <dwr:param name="beanName" value="addressAjaxService"/>
    </dwr:create>

However, this gives me all of the methods from the Impl class.  I tried various permutations of the tags, but I was unable to get the same behavior.  Is there an easy way of doing this just using DWR?  I know that I could manually include/exclude methods, but that would slightly defeat the purpose of using the interfaces in the first place.  Thanks.

- Shawn


Re: Re: dwr.xml vs spring configuration and interfaces

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you use 3.0 instead? There have been many improvements to split DWR configuration in several Spring files. dwr:remote and dwr:proxy-ref should be pretty much what you need.

Regards

On Mon, Oct 19, 2009 at 9:10 PM, Shawn Zeller <sazeller@...> wrote:

> Have you tried dwr:remote better?

I started down that route but the way we have the spring config files divided up, it made more sense to do it with dwr:create.  My initial assumption is that it would probably map pretty cleanly to the dwr.xml, which it does, except for this one issue.


On Fri, Oct 16, 2009 at 5:10 PM, Shawn Zeller <sazeller@...> wrote:
Hello -

I'm converting a project at work from DWR 1.1 to DWR 2.0.5 and there is an odd inconsistency.  I started with changing the project to use the DwrController instead of the servlet while still using the dwr.xml  All of that worked fine.  However, I'll have a section in the dwr.xml that will be something like this:

    <create creator="spring" javascript="addressAjaxService">
      <param name="beanName" value="addressAjaxService"/>
      <param name="class" value="com.foo.AddressAjaxService"/>
    </create>

where the bean is declared like this:

  <bean id="addressAjaxService" class="com.foo.AddressAjaxServiceImpl" />

When I use the dwr.xml, the test page shows just the methods that are in AddressAjaxService.  I could use the spring tags intead like this:

    <dwr:create javascript="addressAjaxService" type="spring">
      <dwr:param name="beanName" value="addressAjaxService"/>
    </dwr:create>

However, this gives me all of the methods from the Impl class.  I tried various permutations of the tags, but I was unable to get the same behavior.  Is there an easy way of doing this just using DWR?  I know that I could manually include/exclude methods, but that would slightly defeat the purpose of using the interfaces in the first place.  Thanks.

- Shawn