Browser History Without Fragments?

Hi,

I have a site up built with Vaadin called http://Notepaedia.com

I need to have the back button working with URLs >WITHOUT< fragments (#). The site makes no sense with fragments.

For example, click here:
http://notepaedia.com/vaadin1

Then here:
http://notepaedia.com/vaadin2

Now, clicking on the browser back button will make the browser title bar flick for an instant showing vaadin1 but it will then show vaadin2 again and the textarea will show vaadin2 also, although the browser URL shows vaadin1 (the one expected to be shown).

The behavior above is seen in Firefox4 and Chrome 10 and my URIHandler is >not< called when back is pressed.

In IE8, everything works as expected and my URIHandler is called when back is pressed.

Is this somehow related to caching? Can I get this to work consistently on all browsers?

Thanks, Klaus.

Great idea for an app!

As a side-note: Editing front page says “Null Pointer Exception”. Maybe a more friendly exception would be better?

The inconsistency between browsers definitely seems like a bug. Could you create a simple isolated test-case and submit it as a
bug report
.

I would suggest to use urls of form:
http://notepaedia.com/#foo/bar instead of http://notepaedia.com/foo/bar

This would make the site a lot faster when navigating between different notes as there would be no page change in the middle. To promote the practice, you could redirect from http://notepaedia.com/foo/bar to http://notepaedia.com/#foo/bar on your web server before handing the control to application servlet.
Unfortunately this leads to one limitation in Vaadin 6 - it needs to load the main page before handling uri fragment. This will be fixed in Vaadin 7, but before that you could configure you web server to redirect from http://notepaedia.com/ to http://notepaedia.com/# and ensure that a http://notepaedia.com/ would look empty to get rid of visual flicker.

Couple of ideas:

Set the main page textfield to read-only. This would avoid confusion on what happens when you edit.

“hard to guess” urls do not provide a proper security measure as the URL is easily forgotten to browser history. Allow setting a proper password to a page. Just add a public/read-only/private combobox to the bottom of the page. Selecting “private” would then ask to set a password.

Hey Joonas!

Thanks for the quick reply. I was expecting to get a notification in my email when you replied…

I conclude it is not possible to control browser history in Vaadin without Fragments. Any plan for that?

I will consider your suggestions.

I am the author of Prevayler and I am planning to provide a service similar to GAE, Heroku, etc but based on Prevayler + Vaadin. Killer combination in my opinion.

Thanks for a great product and great support!

Klaus

Done :slight_smile:

http://dev.vaadin.com/ticket/6971