第一个DWR程序遇到的问题

 今天在学习DWR时,按着参考文档编写第一个DWR程序,在写完程序后发现报如下异常:

org.directwebremoting.util.CommonsLoggingOutput error 严重: A request has been denied as a potential CSRF attack.

解决方案,将web.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> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> </servlet>

之后,报错:allowScriptTagRemoting is false

将web.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> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>allowScriptTagRemoting</param-name> <param-value>true</param-value> </init-param> </servlet>

 

你可能感兴趣的:(第一个DWR程序遇到的问题)