I have used the new ServiceHandler to register images. I used an incrementing counter to create unique ids seperately for each user session (with SessionSingletonBase ..). I now noticed in a multi user environment, that the ids have to be unique among all client sessions. Is this the intended behavior?
I use the ids like this (slightly changed example from [1]):
int id = 0; // This comes from a SessionSingleton
ServiceManager manager = RWT.getServiceManager();
String did = "download" + id++;
manager.registerServiceHandler( did, new DownloadServiceHandler() );
String url = manager.getServiceHandlerUrl( did );
I changed the ID generation to this(works fine):
String did = "download" + id++ + RWT.getUISession().getId();
It just seemed a little odd to me, that the ID is not scoped in the UISession.
I thought it might not hurt to post it here, to make sure it is no bug .
ServiceHandlers have application scope. Thus you should register them
only once with a fixed id. However, the service handler has access to
the current UISession.
If you need a sequence id for your downloads, you could either increment
it in your service handler directly, or you could append it as parameter
to your URL like this: