Many, many thanks for this! Very much appreciated. - Kaspar
On 29.08.2008, at 15:15, Martijn Dashorst wrote:
We just do it in CustomRequestCycle#onEndRequest():
@Override
protected void onEndRequest()
{
if (Application.get().isDevelopment())
{
// controleer of er hibernate objecten in de pagina vastgehouden
worden.
// eerst de pagina die het request heeft beantwoord
Page requestPage = getRequest().getPage();
testDetachedObjects(requestPage);
// als de response een Page heeft, dan deze controleren
op de
aanwezigheid van
// hibernate objecten.
if (getRequestTarget() instanceof IPageRequestTarget)
{
Page responsePage = ((IPageRequestTarget)
getRequestTarget()).getPage();
if (responsePage != requestPage)
{
testDetachedObjects(responsePage);
}
}
}
And:
private void testDetachedObjects(final Page page)
{
if (page == null)
{
return;
}
try
{
NotSerializableException exception = new
NotSerializableException();
EntityAndSerializableChecker checker = new
EntityAndSerializableChecker(exception);
checker.writeObject(page);
}
catch (Exception ex)
{
log.error("Couldn't test/serialize the Page: " + page + ", error:
" + ex);
}
}
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]