You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alexey Buistov <ja...@ua.fm> on 2004/10/26 15:50:22 UTC

Property not resetting between requests

Hello, 

My component has a property of type java.util.HashMap (not persistent one). Is 
it possible that this property is NOT being reset to NULL between requests? I 
dump this property's value in the beginning of pageBeginRender() method and 
its always represents the previous requests's results.

Thanks,
Alexey
----
http://rabota.alkar.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property not resetting between requests

Posted by Galen Meurer <si...@galenmeurer.com>.
What you have done in initializing the Map in pageBeginRender is (as I
understand it) the expected and correct way to do this.

See the first two entries on http://wiki.apache.org/jakarta-tapestry/Gotchas
or search this list for "initialize" or "pageBeginRender". The short version
is that pages are pooled and these instance variables will come back with
the page. If they are not global values valid for all users of the page then
you should be initializing them in pageBeginRender (as you do below). If you
want to reset them before the page goes back in the pool, implement
PageDetachListener and do so in pageDetached
(org.apache.tapestry.event.PageDetachListener#pageDetached(org.apache.tapest
ry.event.PageEvent)).

Best,
Galen;

----- Original Message -----
From: "Alexey Buistov" <ja...@ua.fm>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, October 26, 2004 7:55 AM
Subject: Re: Property not resetting between requests


> Adolfo,
>
> component code fragment
> ========================
>
> public abstract class WeekView extends AbstractCalendar{
>
> public abstract HashMap getDailyEntries();
>
>      public void pageBeginRender(PageEvent event) {
>
>          System.out.println(getDailyEntries());  // I expect NULL here....
>
>          setDailyEntries(new HashMap()); // if not, the map isnt empty :(
>          .....
>
>          loadThisWeekData(); // updates the "dailyEntries" by putting some
> stuff into it.
>      }
>
> }
>
> component spec code fragment
> =============================
>
> <component-specification allow-body="no" allow-informal-parameters="no"
> class="WeekView">
> <property-specification name="dailyEntries" type="java.util.HashMap"/>
>
> .................
>
> </component-specification>
>
>
> Hope this will clarify the situation
>
> Alexey
>
[...]


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property not resetting between requests

Posted by Alexey Buistov <ja...@ua.fm>.
Adolfo,

component code fragment
========================

public abstract class WeekView extends AbstractCalendar{

public abstract HashMap getDailyEntries();

     public void pageBeginRender(PageEvent event) {

         System.out.println(getDailyEntries());  // I expect NULL here....

         setDailyEntries(new HashMap()); // if not, the map isnt empty :(
         .....

         loadThisWeekData(); // updates the "dailyEntries" by putting some 
stuff into it. 
     }

}

component spec code fragment
=============================

<component-specification allow-body="no" allow-informal-parameters="no" 
class="WeekView">
		<property-specification name="dailyEntries" type="java.util.HashMap"/>

.................

</component-specification>


Hope this will clarify the situation

Alexey


On Tue, 26 Oct 2004 09:39:06 -0500
  "Adolfo Ruiz" <ar...@legosoft.com.mx> wrote:
> Hello wuy dont you give some code
> 
> ----- Original Message ----- 
> From: "Alexey Buistov" <ja...@ua.fm>
> To: <ta...@jakarta.apache.org>
> Sent: Tuesday, October 26, 2004 08:50
> Subject: Property not resetting between requests
> 
> 
> > Hello,
> >
> > My component has a property of type java.util.HashMap (not persistent
> one). Is
> > it possible that this property is NOT being reset to NULL between
> requests? I
> > dump this property's value in the beginning of pageBeginRender() method
> and
> > its always represents the previous requests's results.
> >
> > Thanks,
> > Alexey
----
http://rabota.alkar.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Property not resetting between requests

Posted by Adolfo Ruiz <ar...@legosoft.com.mx>.
Hello wuy dont you give some code

----- Original Message ----- 
From: "Alexey Buistov" <ja...@ua.fm>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, October 26, 2004 08:50
Subject: Property not resetting between requests


> Hello,
>
> My component has a property of type java.util.HashMap (not persistent
one). Is
> it possible that this property is NOT being reset to NULL between
requests? I
> dump this property's value in the beginning of pageBeginRender() method
and
> its always represents the previous requests's results.
>
> Thanks,
> Alexey
> ----
> http://rabota.alkar.net/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org