Posts Tagged ‘java’

Incremental search for JavaDoc in FireFox

November 23, 2009

The following Greasemonkey userscript will add an incremental search feature to any JavaDoc displayed in the browser.

http://www.teria.com/~koseki/tools/gm/javadoc_isearch/index.html

In order to use the script you’ll need the Greasemonkey addon, too: https://addons.mozilla.org/de/firefox/addon/748

Advertisements

Force page reload on back/forward button in Firefox 3.x

November 16, 2009

When using the back/forward buttons in FF3.x, pages are cached and delivered from cache very strictly. Obviously (unlike normal caching) even page headers like Pragma, Expires etc. are ignored. This special cache is often referred to as bfcache (back/forward cache).

This behavior caused exceptions in my wicket app, where ajax funtionality is used, here’s what happens:
* Load page containing panelA
* User interaction, replacing panelA with panelB using ajax
* User clicks back button
* User clicks forward button
-> initial page content (markup) is loaded from fbcache, including panelA
-> in wicket pageMap, panelA is not existent, since it has been replaced with panelB
* User interacts with an ajax element on panelA
-> exception is thrown “Component x not found on page”

Solution: add an unload handler to the page’s body tag. This causes firefox to reload the page instead of simply grabbing it from bfcache, so that server and client side state is in sync again 🙂

Regular Expressions: Match all alphanumeric characters

November 3, 2009

[\p{L}\p{N}]

Where
\p{L} matches all letters
\p{N} matches all numbers

More information