在web.xml配置文件中dwr的配置加入corssDomainSessionSecurity這個配置選項..這個參數是在dwr版本2.0纔有的.默認值爲true,也就是禁止其餘域發送請求.corssDomainSessionSecurity:設置成false可以從其餘域進行請求.注意這樣作會在安全性上有一些冒險.web
<servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping>