Why does running multiple Wicket applications cause AJAX conflicts?

泄露秘密 提交于 2019-12-22 04:05:41

问题


When I open two Wicket web applications in the same browser, it seems there are AJAX conflicts as I see a full page refresh in place of a partial refresh. This is true even if the applications are on different servers and port numbers.

I only use the out-of-the-box JavaScript provided by Wicket (tabbedPanel, onTimerAutoRefresh).

Perhaps it is something related to the fallback function.

When only one web application is open, it works without any problems.

I don't have a problem on the examples site, so I think something is wrong with the configuration of my application.

wicket-ajax.js, line 970:

try {
    redirectUrl = t.getResponseHeader('Ajax-Location');
} catch (ignore) { // might happen in older mozilla
}

// the redirect header was set, go to new url
if (typeof(redirectUrl) != "undefined" &&
    redirectUrl != null &&
    redirectUrl != "") {
    //redirect and do a full page refresh (window.location = redirectUrl);
}else{
    // do the normal ajax functionality
}

When everything is okay, there is no Ajax-Location in the header. When the second web application is loaded in the same browser, then the next AJAX request on the first loaded web application gets this line in its header:

[Ajax-Location: .]


回答1:


Can you check that the root context of your applications is different? Otherwise, you could have a conflict at cookie level. They are stored based on the hostname and the path. If the context path of both application is "/", then the cookie values will be overwritten. Whence the conflict that you see.



来源:https://stackoverflow.com/questions/5619388/why-does-running-multiple-wicket-applications-cause-ajax-conflicts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!