You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lukasz Kucharski <lk...@gmail.com> on 2005/06/08 23:13:10 UTC
Encapsulating common functionality in SuperPage HOW?
HI
I have the following problem.
I'd like to extract common functionality for all pages into one
MyBasePage which implement this common functionality.
Problem 1:
MyBasePage extends BasePage and add some functionalities there,
including some properties. I cannot declare properties in page
specification and use abstract getters/setters because I need pure
implementation here. So i need to ensure each property is reset after
page gets back to the pool. Here is the strange part
public class GenericPage extends BasePage {
protected Logger log = Logger.getLogger(GenericPage.class);
private String message = "";
public void initialize()
{
//log.debug("Calling initialize in : generic" );
this.message = "DUPAAA";
}
(...)
}
I don't get it, you see, every time i uncomment log line in
initialize method i get NullPointerException !!! and don't even know
why. What is worse message String doesn't get initialized here for
"DUPAAA" and when i read it in oter child class it gives me " " blank
value.
Please help!
2: Is this method of mine for common functionality encapsulation any
good or maybe someone knows better solution?
Thanks in advance!
--
Pozdrawiam
Lukasz Kucharski
lkucharsNOSPAM@gmail.com
lkucharsNOSPAM@students.depaul.edu
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org