9

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: .]

Pops
  • 30,199
  • 37
  • 136
  • 151
Benoit
  • 503
  • 4
  • 14
  • I think we'll need more details to be able to help. – Don Roby Apr 11 '11 at 11:15
  • first topic edited and more comments added. – Benoit Apr 11 '11 at 14:57
  • this happens only when the same domain is used even if the port is different. but when I change the domain, then there are no issue. with the wicket in action "partialajax" project example I have a "Page Expired The page you requested has expired." error. – Benoit Apr 13 '11 at 08:23
  • Ajax-Location in the wicket example is : Ajax-Location: ?wicket:bookmarkablePage=:org.apache.wicket.markup.html.pages.PageExpiredErrorPage – Benoit Apr 13 '11 at 08:30

1 Answers1

8

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.

bernardn
  • 1,701
  • 5
  • 19
  • 23