« Return to Thread: Reverse AJAX help, please :(

Reverse AJAX help, please :(

by stojadinovicp :: Rate this Message:

Reply to Author | View in Thread

Hi guys, great job.

I have a small problem with Reverse AJAX. Well, I can't get it to work or I do not understand the concept.

I have this setup in web.xml:
                <init-param>
                        <param-name>activeReverseAjaxEnabled</param-name>
                        <param-value>true</param-value>
                </init-param>
                <init-param>
                        <param-name>org.directwebremoting.extend.ServerLoadMonitor</param-name>
                        <param-value>org.directwebremoting.impl.PollingServerLoadMonitor</param-value>
                </init-param>
                <init-param>
                        <param-name>timeToNextPoll</param-name>
                        <param-value>999</param-value>
                </init-param>
and I call this line at the beginning: dwr.engine.setActiveReverseAjax(true);
And this is all well documented on the DWR website. But what is missing there is the Java code for the Reverse AJAX.

I ran into some code by searching:
                WebContext wctx = WebContextFactory.get();
                if (wctx == null) System.out.println("processRoomServerEvent: WebContext is null. Drat.");
                else wctx.getScriptSession().addScript(new ScriptBuffer(js));
But when I do this it gives me wctx to be null always. Then I tried getting the wctx from a method which I call from JS and then wctx is OK but this time the Reverse AJAX call goes only to the page which called the method, in other words it doesn't go to all the users.

Can anyone point me in the right direction on the Java side of things? I just need to make a JS call to ALL users.
Thanks!

 « Return to Thread: Reverse AJAX help, please :(

LightInTheBox - Buy quality products at wholesale price