`

A request has been denied as a potential CSRF attack

    博客分类:
  • DWR
阅读更多

dwr遇到这种错误:
org.directwebremoting.util.CommonsLoggingOutput error
严重: A request has been denied as a potential CSRF attack.

在参照dwr的官方网站时,如果在后台出现如下的提示信息:A request has been denied as a potential CSRF attack

则,需要在web.xml中的如下配置修改一下

xml 代码
  1. <servlet>  
  2.     <servlet-name>dwr-invokerservlet-name>  
  3.     <servlet-class>uk.ltd.getahead.dwr.DWRServletservlet-class>  
  4.     <init-param>  
  5.         <param-name>debugparam-name>  
  6.         <param-value>trueparam-value>  
  7.     init-param>  
  8. servlet>  

修改为:

xml 代码
  1. <servlet>  
  2.     <servlet-name>dwr-invokerservlet-name>  
  3.     <servlet-class>uk.ltd.getahead.dwr.DWRServletservlet-class>  
  4.     <init-param>  
  5.         <param-name>debugparam-name>  
  6.         <param-value>trueparam-value>  
  7.     init-param>  
  8.     <init-param>  
  9.         <param-name>crossDomainSessionSecurityparam-name>  
  10.         <param-value>falseparam-value>  
  11.     init-param>  
  12.   servlet>  

即加入了跨域调用功能

 

报错:allowScriptTagRemoting is false

在WEB.xml中加入:

<init-param>
<param-name>allowScriptTagRemoting</param-name>
<param-value>true</param-value>
</init-param>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics