You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ai...@bt.com on 2010/01/06 13:09:42 UTC

Tapestry, Page Object State and Clustering

Hi there,
Ive checked the archive and havent been able to find anything that
answers this so here goes...
Im just discovering T5 and have a query regarding the T5 page object and
how it maintains state (without using the session) from render ->
through the user interacting with the browser -> to submit.  I cant see
how its doing this in a manner which I can ignore when considering
clustering..

Example of what I mean
public class ManageDataRoles extends AbstractAuthenticatedPage
{
	//Note this isnt persisted or added to session
	private ArrayList<DataRole> roles;
	<SNIP>	
	void onSuccess()
	{
		System.out.println("MANAGEDR"+roles.size());
	}
}

So when I render the page the size is 3.
When I submit the page and reference "roles" the size is 3.
Where is this "roles" object being persisted while im happily messing
around with the rendered page in firefox?
Hopefully this makes sense.
Aidan

Re: Tapestry, Page Object State and Clustering

Posted by Ulrich Stärk <ul...@spielviel.de>.
Depends on where your list gets instantiated and populated. I can only guess, but you are probably 
filling it with some values in onActivate(), right? This happens every time that page is used to 
handle a specific request, be it a page render or a form submit. That's where your "state" comes from.

HTH,

Uli

On 06.01.2010 13:09 schrieb aidan.ohagan@bt.com:
> Hi there,
> Ive checked the archive and havent been able to find anything that
> answers this so here goes...
> Im just discovering T5 and have a query regarding the T5 page object and
> how it maintains state (without using the session) from render ->
> through the user interacting with the browser ->  to submit.  I cant see
> how its doing this in a manner which I can ignore when considering
> clustering..
>
> Example of what I mean
> public class ManageDataRoles extends AbstractAuthenticatedPage
> {
> 	//Note this isnt persisted or added to session
> 	private ArrayList<DataRole>  roles;
> 	<SNIP>	
> 	void onSuccess()
> 	{
> 		System.out.println("MANAGEDR"+roles.size());
> 	}
> }
>
> So when I render the page the size is 3.
> When I submit the page and reference "roles" the size is 3.
> Where is this "roles" object being persisted while im happily messing
> around with the rendered page in firefox?
> Hopefully this makes sense.
> Aidan
>

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