First of all it's a pity the imports have been removed - that does not help it, really. For those wondering what that Util class is, add this after your package name:
import org.directwebremoting.proxy.dwr.*;
Oh what the heck, here's the full header:
import java.util.LinkedList;
import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;
import org.directwebremoting.proxy.dwr.*;
import java.util.Collection;
!!!!!!!!!!!!!!!!!!!!!!!
I have a question. Most of the articles about using Reverse AJAX with DWR I saw these includes in the main HTML page:
<script type='text/javascript' src='javascript/engine.js'> </script>
<script type='text/javascript' src='../dwr/interface/JavaChat.js'> </script>
<script type='text/javascript' src='javascript/util.js'> </script>
I do not get it ... do I have to unpack the dwr.jar to extract them and put manually into the WebContent dir under some Javascripts dir and then change the paths, OR, by some mirace DWR does that itself. Because as it is now, the HTML will NOT find those three .js files there. Now, the dwr.jar does contain util.js and engine.js, but it does not contain that 3rd js which Martin says DWR generates automatically - I've checked the deployment dir of the webapp:
C:\JWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\Rajax
There are no javascripts at all !
Which leads to a conclusions that all the DWR examples I've seen do not work for me.
May I ask for some details regarding these magical tricks behind our backs?
Also, the article describes how to set up the rajax app, but it does not describe the inner workings. Some diagrams would help. Basically some details would help. And omittiing the imports is certainly not a good idea.
But thanks for the article anyway. The intro is great. |