> 1.say I go to an app at localhost/MyApp/app
> 2.App's home page is HomePage.class; its' constructor executes
> 3.I do browser reload, HomePage's contructor is executed again (so I'm
> getting a new object and not one costructed in #2)

Your home page is a bookmarkable page (and are thus not session
relative), and bookmarkable pages are constructed for every request.
Older instances will by default be pushed to second level cache. If
pages are stateless, they are discarded right away and will not be
part of the session store's history (we don't need that because the as
state doesn't matter for these pages, we can construct them from
scratch on every request, even for the back button).

> How can I get Wicket to reuse object from #2 in step 3?

You typically don't unless you have a very specific reason for it. But
if you want, you can implement a custom page factory for instance.
Though that's probably pre-mature optimization. If you navigate
between pages, you can reuse instances by passing references to those
pages. A typical use for that is when you have a list and a detail
screen and from that detail screen you want to navigate 'back'. Again,
if the only reason you want to do such things is efficiency, you're
probably prematurely optimizing.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to