« Return to Thread: DWR 2 and Spring 2

Re: DWR 2 and Spring 2

by Brendan Grainger-2 :: Rate this Message:

Reply to Author | View in Thread

Sure, I'm assuming you have spring MVC working.

I have this in my springDispatcher-servlet.xml (or something similar).

    <bean id="ajaxService" class="com.yourpackage.YourService">
        <dwr:remote javascript="ajaxServiceNameInJavascript">
            <dwr:include method="getAllEntries" />
            <dwr:include method="getAllCategories" />
        </dwr:remote>
        <property name="someProperty" ref="propertyRef" />
    </bean>

I have something like this in my web.xml:

    <servlet>
        <servlet-name>springDispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- For regular spring controllers -->
    <servlet-mapping>
        <servlet-name>springDispatcher</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <!-- Needed for dwr -->
    <servlet-mapping>
        <servlet-name>springDispatcher</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

HTH
Brendan


On 12/16/06, Lexius <lexius.info@...> wrote:



Brendan Grainger-2 wrote:

>
> Hi,
>
> Try this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns=" http://www.springframework.org/schema/beans" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:aop=" http://www.springframework.org/schema/aop" xmlns:tx="
> http://www.springframework.org/schema/tx"
>     xmlns:dwr=" http://www.directwebremoting.org/schema/spring-dwr"
>     xsi:schemaLocation="
>                http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>                 http://www.directwebremoting.org/schema/spring-dwr
> http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd"
>                default-lazy-init="false"
>                >
>
>     <!--  AJAX Facades -->
>     <dwr:configuration>
>
>         <dwr:convert type="bean" class="
> org.directwebremoting.spring.TestIncludesBean "  >
>             <dwr:include method="includedProperty" />
>         </dwr:convert>
>
>         <dwr:convert type="bean" class="
> org.directwebremoting.spring.TestExcludesBean "  >
>             <dwr:exclude method="excludedProperty" />
>         </dwr:convert>
>
>          <dwr:convert type="bean"
> class="org.directwebremoting.spring.Check "
> />
>
>     </dwr:configuration>
>
> </beans>
>
> I am using the DWR and Spring Namespace integration successfully so let me
> know if you need anything more.
>
> HTH
> Brendan
>
> On 12/16/06, Lexius <lexius.info@...> wrote:
>>
>>
>> Does anyone have any working example
>> configs?
>>
>> ...
>> xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
>> http://www.directwebremoting.org/schema/spring-dwr
>> http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
>> ...
>>
>>
>> <dwr:controller id="dwrController" debug="true" />
>>     <dwr:configuration>
>> .....
>>
>>
>> ?
>> --
>> View this message in context:
>> http://www.nabble.com/DWR-2-and-Spring-2-tf2832281.html#a7907311
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

Thanks for reply.
Can you show me:

<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
....
<servlet-mapping> for Spring in web.xml
...
and how to use <dwr:remote javascript=""

My config not working for me :(
--
View this message in context: http://www.nabble.com/DWR-2-and-Spring-2-tf2832281.html#a7907637
Sent from the DWR - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


 « Return to Thread: DWR 2 and Spring 2