I started learning DWR today and encountered some problems. I always jumped out of session error.
Problem description:
The session error dialog box is displayed on the front-end page.
The console outputs:
11:58:53 org. directwebremoting. util. commonsloggingoutput Error
Severe: A request has been denied as a potential csrf attack.
Error message.
The request is rejected because of possible cross-site request forgeries (Cross-Site Request Forgery) attacks.
That is to say, the page url may be called by a cross-site service.
For example, an image on your own page may be referenced by other sites directly through [img]... [/img.
Solution:
In the Web. xml configuration file ..
DWR Configuration
DWR-invoker
Org. directwebremoting. servlet. dwrservlet
debug
true
crossdomainsessionsecurity
false
Added the corssdomainsessionsecurity configuration option. This parameter is available only in DWR version 2.0. The default value is true, that is
Prohibit other domains from sending requests.
Corssdomainsessionsecurity: if it is set to false, requests can be made from other domains. Note that this may cause some security risks.