dwr调用报Session Error错误

前端之家收集整理的这篇文章主要介绍了dwr调用报Session Error错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

错误描述:项目中所有用到dwr的地方,都显示“Session Error”错误

解决方法:在web.xml中添加

<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>

于是,完整的dwr配置如下:

	<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>activeReverseAjaxEnabled</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>initApplicationScopeCreatorsAtStartup</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>maxWaitAfterWrite</param-name>
      <param-value>500</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    
    <init-param>   
    <param-name>crossDomainSessionSecurity</param-name>
    <param-value>false</param-value>
   </init-param>
   
  </servlet>

  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>
但为啥加这段话,我还不理解,查完资料后,再整理补充原因吧~吃饭去喽~ 原文链接:https://www.f2er.com/ajax/166526.html

猜你在找的Ajax相关文章