I would bet that you are running with the specification caching turned off
for development. The initialize() method is only called when the page is put
back in the pool, not on the first time it is created as I recall. If you
are running with caching turned off, new instances of you page specification
are being created each request.

Richard

-----Original Message-----
From: Lukasz Kucharski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 08, 2005 3:34 PM
To: Hensley, Richard
Cc: Tapestry users
Subject: Re: Encapsulating common functionality in SuperPage HOW?

> 
> 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 static Logger log = Logger.getLogger(GenericPage.class);
> 
>         private String message = "";
> 
>         public void initialize()
>         {
>super.initialize()
>                 log.debug("Calling initialize in : generic" );
>                 this.message = "DUPAAA";
>         }
> (...)
> 
> }
> 

OK. I now know where the problem is. Message did not want to
initialize to "DUPAAA" value although initialize methods were running
succesfuly. It's pretty strange and I would be gratefull if someone
could explain it to me:
When i write:
private String message;
instead of:
private String message = "";

everythign goes smoothly, message gets initialized in initialize
method and so on. But if i leave this ="" part things are getting
unpredictable... at least  for me. Anyone has a clue?


-- 
Pozdrawiam

Lukasz Kucharski
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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

Reply via email to