dwr写demo的时候遇到的一个问?跛_session error
问题描述:
前台面跛_session error的对话框
而控制台则输?
2007-5-29 11:58:53 org.directwebremoting.util.CommonsLoggingOutput error
严重: A request has been denied as a potential CSRF attack.
的错误信?
h被拒l因为可能存在csrf(cross-site request forgeries,跨站h伪?d.
也就是说面URL可能被跨站了的服务所调用.
例如:自己面的一个图?可能被其他站直接通过[img]....[/img]来引?
面则显C?/p>
解决Ҏ:
在web.xml配置文g?.
dwr的配|?br />
<
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
>
加入corssDomainSessionSecurityq个配置选项..q个参数是在dwr版本2.0才有?默认gؓtrue,也就?/p>
止其他域发送请?
corssDomainSessionSecurity:讄成false能够从其他域q行h.注意q样做会在安全性上有一些冒?

]]>