web.xml配置如下:
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<servlet-class>org.dirrectwebremoting.servlet.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>
</servlet>
crossDomainSessionSecurity设成false使能够从其它域进行请求。注意,这样做在安全上会有点冒险,参考下面这篇文章,在没有理解这个后果前不要设置成false.
http://hi.baidu.com/%C9%ED%B4%A6%BD%AD%BA%FE/blog/item/f8b8587f9e63af320dd7daff.html