Search code examples
gwthyperlinkevent-handlinghrefreload

A way to control a web page with external link without reload


We have a GWT based thick client like web application. The application is considerably large and has some initial load time.

We would like to send the users of our application e-mail messages with href links that would open up a specific asset in our application. Well this of course has the effect that clicking the link opens up the application again, reloads it which we would like to avoid. Ideally we would like the href link to just signal our application/web page somehow so that we could pick up the event in our application and react to it.

Any ideas how we should approach this or is this even possible ?

Thanks!


Solution

  • There seems not to be any elegant solution to send an event from a link to an existing browser window. Few solutions I have encountered this far:

    a) Implement a cookie polling solution for the application to poll if a cookie exists or changes. The link points to our server which just sets the cookie and this way informs the running app about the event. Some tricky handling should be implemented with some kind of 2-way protocol between the returned temporary page from server to handle the situation where the application is not (yet) running.

    b) The same approach as in solution a) but use html5 local storage for communication. This way the poller is not needed as the local storage fires an event when content changes. This would be a possible solution but is not for me as we have to support older browsers without local storage support.

    c) A long polling ajax or a web socket for delivering events from the server to the client. A solution but seems overkill and might require a modern browser for atleast web sockets.