Use PhoneGap to do mobile client, server with SPRING+DWR, need to access the server on the phone method, you need to do the following configuration, you can see http://www.iteye.com/topic/337460:
Server DWR configuration (Web. xml):
<Init-param> <Param-name>Allowgetforsafaributmakeforgeryeasier</Param-name> <Param-value>True</Param-value> </Init-param> <Init-param> <Param-name>Crossdomainsessionsecurity</Param-name> <Param-value>False</Param-value> </Init-param> <Init-param> <Param-name>Allowscripttagremoting</Param-name> <Param-value>True</Param-value> </Init-param>
Mobile Client JS
<script type= ' text/javascript ' src= '/ajax_chat/dwr/engine.js ' ></script> <script type= ' text/ JavaScript ' src= '/ajax_chat/dwr/util.js ' ></script> <script type= ' text/javascript ' src= '/http Www.myspace.com:8080/DWR_cross/dwr/interface/TestCross.js ' ></script> <script type= "text/ JavaScript "> function sendmsg () { dwrengine.setmethod (dwrengine.scripttag); Testcross.greeting (Dwrutil.getvalue ("userName"), function (data) {alert (data);});
Other server-side Java, Dwr.xml no special. It should be pointed out that the 3rd behavior in client JS requires a cross-site Dwr method, as for the 2nd, 3 lines, as needed.
iOS Development-cross-domain access to the Dwr method