views:

302

answers:

3

We've got an Eclipse RAP application that's behaving a bit strangely in Firefox - two distinct problems.

When you browse around, you can click on a button in one part of the system. This opens a popup window like so:

IWorkbenchBrowserSupport bs;
bs = PlatformUI.getWorkbench().getBrowserSupport();
int style = IWorkbenchBrowserSupport.AS_EXTERNAL;
IWebBrowser b = bs.createBrowser(style, getRandomID(), "Hello world", "");
b.openURL(new URL(...));

where the URL is another servlet in the application. This servlet is in the same runtime, but has nothing to do with RAP - it takes a binary blob from in-memory storage and dumps it in the output stream.

Problem 1: This causes the HTTP session to die in firefox, and shows the "session expired" RAP error page with a link to restart the session.

Problem 2: Now, when you click on the link to restart the session, it shows the application's dialog again, but the session expired error is shown again the moment you do anything. This prevents the user from using the system again, unless Firefox is closed down completely and restarted. A quick peek with FireBug reveals that the JSESSIONID passed by Firefox does not change.

Has anyone seen this before?

A: 

How long is the dumping of the stream to the output? May it cause a timeout? As RAP uses Javascript calls, it might be much shorter than the normal timeout time.

For problem 2: Firefox caches a lot of things; and if the Javascript execution hangs, it might cause such problems.

Are these problems present in other browsers? It might be a good idea to check with the internal browser (or any other browser with a different rendering engine).

Zoltán Ujhelyi
A: 

It turns out that if a RAP application opens a popup window pointing to a servlet in the application itself, inside the current HTTP servlet context, the session is killed. Fixed by creating a dummy HTTP context for the servlet in question.

Fritz H
A: 

If you need to deliver content from within the same application, you should use a service handler instead. See this FAQ: http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link.3F

ralfstx