touchkit URI Handler problems


i am using an URI Handler in a normal Vaadin application and
exactly the same way in a Vaadin-Touchkit application.

Everything works fine in the normal app,
the handler gets called on every page refresh,
and forks based on the relativeURI:

getMainWindow().addURIHandler( new URIHandler()
	public DownloadStream handleURI( final URL context, final String relativeUri )
		return myURIHandler( context, relativeUri );
} );

protected DownloadStream myURIHandler( final URL context, final String relativeUri )
	Logger.trace( getClass().getSimpleName() + ".myURIHandler(" + context + "," + relativeUri + ")" );
	if ( relativeUri.startsWith( ) )
		return handleIsAlive();
	if ( relativeUri.startsWith( ) )
		return handleLostCredentials();
	return null;

The Alive-Handler returns a simple text with a Timestamp,
the LostCredentials-Handler displays a form and returns null.

The main problem is, that myURIHandler does not get called
as expected in the Touchkit application.
Sometimes it doesn’t get called at all, sometimes it gets called twice.
If it gets called on a page refresh, it doesn’t get called on the next refresh.

For me, it looks like some caching prevents the page to get reloaded,
even if i restart my tomcat/eclipse, so it may be some browser cache?

I have this behaviour with the eclipse-browser, Chromium and Firefox.
Opera seems to do it right.

But why is there a difference between normal and Touchkit Apps
on the misbehaving browsers?


BTW: The browser on an iPhone 4S works, too.
One call of myURIHandler on every refresh.


From other thread:

Someone knows, when they will be back?



Hard to say with these details what exactly goes wrong, but with correct headers TouchKit should work just like normal Vaadin app. For which resource are you using the uri handler, what is returned by it? For the “host page”? TouchKit uses html5 cache manifest and stronger caching to allow mobile apps to start up faster and even work offline. And cache manifest lists the host page indeed. Some odd requests may appear when the browser is checking for changes on the background (app then already started).

BTW. If you have a serious project going on and have a change you might need professional help, I’d suggest to sing up for our pro account. Via it you can contact our experts via priority channel and have much better response times than via this “community forum”.


Hi Matti,

thanks for your reply.

as i wrote, i added the uri handler to the main window (with getMainWindow().addURIHandler() ), is that what you mean?
And the results from the handler are:

(see my code snippet)

Can this be disabled for more testing?

That ‘90$ * 12 = 1080$ per year plus 230$ per hour developer support’ thing?
We just paid ~ 500€ for the Touchkit already… :wink:

Is there more documentation for the touchkit than i found until now?
I know the part in the Book-Of-Vaadin and the Wiki-Pages,
but the Wiki-Pages are outdated. Most of the time i look into the source
of the MobileMail and vOrnitologist demos…


I also want to know how to disable that cache manifast stuff. When editing CSS, Chrome is always showing a cached version, even when I disable Caching in Chrome.

Regards, Sebastian

Starting Chrome with --disable-application-cache solved my problem.