O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing the last selected tab name in cookies

Cookies are small pieces of data that are stored in the user's web browser. They can be considered as a small database. Each cookie is defined by a name and value of String. Cookies have many uses. Perhaps the most common use is user authentication.

In this recipe, we will show how to store information about the last selected tab name. This example is based on the Binding tabs with a hard URL recipe in Chapter 2, Layouts. We will continue on the same implementation. We add two new methods for read and for write cookie. In the original application, if the user entered the URL without the tab name after the hash-tag #, the first tab was selected. In this new version, the last opened tab will be selected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required