Sorry for my bad english, this is hard to explain...
I get this exception:
I have one base page and two sub-pages which extend my base page
When the markup contains ComponentTag filtered by RelativePathPrefixHandler (ie no wicket:id and href attribute), the request's counter REQUEST_COUNTER_KEY is incremented.
This step is fine and my first page is displayed.
Wicket put the basepage and the first sub-page in cache.
When i want to render the second page, the REQUEST_COUNTER_KEY restarts to 0 BUT : all RelativePathPrefixHandler ComponentTag of the base page keep the same id, which can be the same that one or more RelativePathPrefixHandler ComponentTag of the second sub-page.
The exception occurs only when :
There are RelativePathPrefixHandler ComponentTags in header with <wicket:header-items /> tag or there are RelativePathPrefixHandler ComponentTags in the body of the base page.
The problem is in MarkupContainer :
While rendering the relative Prefix tag in header with wicket:header-items in head, instanceof MarkupContainer is the Page
While getting the component (get(id)), the id occurs twice and the second tag render the first one
( !! this is realy hard to explain.... !!)
The QuickStart app will show you much better what i'm trying to say.
Go to the home page, and click to the "Second Page" link