Hot topics
eBook shop
PDF edition of articles
Window id concept
An approach to leverage the use of the HTTP session
Web Framework Test and Analysis
Article series on web technologies with detailed reviews.
Hibernate eBook
A continuously updated book on Hibernate and Java Persistence
Recent Posts » Feed
- JSF 2 can finally be used in cluster environments » 23 Aug 2010
- Imagine the web improves on 11.11.11 » 15 Jul 2010
- Hibernate Training Update » 20 Apr 2010
- Blogging like a developer » 24 Feb 2010
- Window Id - Practical use cases » 18 Jan 2010
- GWT tip - better exception logging on the server » 18 Dec 2009
- Oh JavaFX, Oh JavaFX - why don't you progress? » 01 Dec 2009
Window id – Practical use cases
This post is part of the window id concept series
The concept of a window id.
The window id is sent as request header by the browser and let you identify the window which sent a request.
Request Header
-—————-
X-Window-Id: 279078917624897
Having this window id, we can store data for a specific window in the user session.
The great advantage of such an id is that we can build more stable multi window web application. In this article, I will describe a number of practical use cases.
Until the id is included in browsers, we can enhance the browsers using a plugin. I build a plugin for Firefox but could provide one for other browsers as well.
I have described the concept in Mai 2009 in an article in this blog.
Use cases
Current menu
Imagine you have a menu to navigate in your web application which allows to open a menu group and select a page to navigate to. It could look like the following sample of JQuery UI or the one of JSF Richfaces.
If the user press ‘Reload page’ or submits data, you won’t to show the menu groups opened which were opened before as well. As a consequence, you need to store the information somehow.
How do you achieve this?
One approach could be to save the information in the page template and open the appropriate menu group.
<meta name="xOpenMenu" content="foo">
+ is simple and works with current browsers
- doesn’t work with multiple open menus. Think of applications like Photoshop or Gimp with a number of menus which can be opened to work with layers, colours, …
We could store the information in the users session.
+ is simple and works with current browsers
- does not work if you want to use the application with multiple windows
Best solution
This is a great use case for the windows id concept. If the browser sends the window id with every request, then you can store the information, which menus are open, per browser window in the user session.
Help needed
If you went to get this into browser, then you can help achieving this.
- Comment on this and show practical use cases in your own blog.
- Vote for Firefox bug Vote for bug https://bugzilla.mozilla.org/show_bug.cgi?id=495395.
- Add a ‘+1’ to the mailing list thread of Webkit (Safari/Google Chrome) on mailing list topic [webkit-dev] Browser issue with multiple tabulators.
- Contact Opera/Microsoft
Best Regards / Viele Grüße
Sebastian Hennebrueder
