I'm having pretty good success with using DWR3 configured to deliver JSON inside of Apache OFBIZ & EXT 4. It's really straight forward and easy to use.
In your web.xml file, you should have something similar to this:
PHP Code:
<servlet> <servlet-name>dwr-invoker</servlet-name> <display-name>DWR Servlet</display-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>jsonpEnabled</param-name> <param-value>true</param-value> </init-param> </servlet>
The key being
PHP Code:
<init-param> <param-name>jsonpEnabled</param-name> <param-value>true</param-value> </init-param>
Then you just do things the normal EXT way. Of course you still need to go through the usual steps of setting up a DWR application and creating your dwr.xml, DwrHelper.java ( or w/e you end up calling it), etc.
Then you just access the functions as normal ( as configured in dwr.xml ): myapp.com/dwr/SomeClass/memberFunc/param1/param2/param3, etc
or
myapp.com/dwr/SomeClass/memberFunc?args=etc
One compromise I had to make was using HttpServletRequest request, HttpServletResponse response as my parameters in any exposed functions. Otherwise you can run in to problems where you're trying to get data from a form and then dynamically build a URL to call your function..ugh.... it ends up making your code ugly and much, much larger than it needs to be... so save yourself the trouble unless you know for sure it won't be a headaches to go the "normal" "restful" route.
There are a few other gotchya's / caveats that I ran in to when I first started using DWR3+EXT... but i don't have time to list them all right now. Will revisit this thread a bit later and post them.
I don't recommend trying using DWR2 w/ the DwrProxy for EXT. It chugs donkey dick and doesn't work on 4.x. If you have the option of not using DWR, or ditching it, then I would look in to EXT Direct.