Bugs item #672743, was opened at 2003-01-22 15:33
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=672743&group_id=4754
Category: None
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Eric Everman (eeverman)
Assigned to: Howard Lewis Ship (hship)
Summary: Pages Implementing Listeners cause NPE
Initial Comment:
Any page that implements PageRenderListener,
PageDetachListener, or PageCleanupListener will throw a
NPE in v2.4 in AbstractComponent.finishLoad(arg1, arg2,
arg3).
All of these listeners assume that the _page field has
been set, but it seems (logically) to be null for a Page.
A possible fix would be to have AbstractPage over-ride
finishLoad(arg1, arg2, arg3) to use 'this' instead of
'_page'.
Eric Everman
----------------------------------------------------------------------
>Comment By: Eric Everman (eeverman)
Date: 2003-01-23 18:07
Message:
Logged In: YES
user_id=219939
Fixed - Great!
I did notice that my posted solution is no good and causes
pages not to render. Unless code is changed in a few other
places, the way to fix this is to either to ensure that
_page is never null (probably not preferable), or modify the
AbstractComponent method to be something like this:
public void finishLoad(IRequestCycle cycle, IPageLoader
loader, ComponentSpecification specification)
throws PageLoaderException
{
/*
* Begin added code for finishLoad NPE bug
* _page field will be null.
*/
IPage _page = this._page;
if (_page == null && this instanceof IPage) {
_page = (IPage)this;
}
/*
* End added code for finishLoad NPE bug
*/
if (this instanceof PageDetachListener)
_page.addPageDetachListener((PageDetachListener) this);
if (this instanceof PageRenderListener)
_page.addPageRenderListener((PageRenderListener) this);
if (this instanceof PageCleanupListener)
_page.addPageCleanupListener((PageCleanupListener)
this);
finishLoad();
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104754&aid=672743&group_id=4754
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer