DWR2.0跨域访问

一、服务端web.xml:

 

<init-param>
	<param-name>crossDomainSessionSecurity</param-name>
	<param-value>false</param-value>
</init-param>
<init-param>
	<param-name>allowGetForSafariButMakeForgeryEasier</param-name>
	<param-value>true</param-value>
</init-param>
<init-param>
	<param-name>allowScriptTagRemoting</param-name>
	<param-value>true</param-value>
</init-param>

 二、客户端JavaScript:

 

RemoteService._path = 'http://yourhost:port/your_app_name/dwr';
DWREngine.setRpcType(DWREngine.ScriptTag);
DWREngine.setVerb("GET");
RemoteService.someMethod();
 

 

你可能感兴趣的:(JavaScript,xml,Web,DWR)