id="iframeu1788635_0" src="http://pos.baidu.com/acom?rdid=1788635&dc=2&di=u1788635&dri=0&dis=0&dai=2&ps=236x804&dcb=BAIDU_UNION_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1457320711432&ti=A%20request%20has%20been%20denied%20as%20a%20potential%20CSRF%20attack.%E2%80%9D%20%7C%20%E5%AD%A6%E6%AD%A5%E5%9B%AD&ari=1&dbv=2&drs=1&pcs=1156x562&pss=1156x256&cfv=0&cpl=4&chi=1&cce=true&cec=UTF-8&tlm=1457320711<u=http%3A%2F%2Fwww.xuebuyuan.com%2F1843812.html<r=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DejKJvmv5bzsZ6gzHraLt_-I2tGSW1VC3V4ffHQB_BM6HmLXdxlU5OInj5SiMvw9F%26wd%3D%26eqid%3Df288193600003d8e0000000556dcf2ac&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=false&cmi=6&col=zh-CN&cdo=-1&tcn=1457320711&qn=6a23d87926e9ca87&tt=1457320711408.62.270.271" width="336" height="280" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="margin: 0px; padding: 0px; border-width: 0px; border-style: initial; font-size: 13px; vertical-align: bottom; background: transparent;">
最近想学AJAX。 刚上来就碰到了这么个错误:“严重: A request has been denied as a potential CSRF attack.” 传递的值还是“session error”。
后来在网上发现了这个问题解决办法。
在web.xml配置文件中修改dwr的配置:
Xml代码
- <servlet>
- <servlet-name>dwr-invoker</servlet-name>
- <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
- <init-param>
- <param-name>debug</param-name>
- <param-value>true</param-value>
- </init-param>
- <!-- 新加corssDomainSessionSecurity参数 -->
- <init-param>
- <param-name>crossDomainSessionSecurity</param-name>
- <param-value>false</param-value>
- </init-param>
- </servlet>
加入红色部分后。问题就消失了。