You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2005/08/24 16:03:42 UTC

Persistance or not?

The example in the tap4 user guide on page injection gives the following 
example 

<inject property="detailsPage" type="page" object="Details"/> 

 public abstract Details getDetailsPage();

 public IPage doShowDetails(long productId)
 {
   Details details = getDetailsPage();

   details.setProductId(productId);

   return details;
 } 


This is almost exactly what I want to do, with my little database 
application as I allow the user to move from a summary list to the details 
page for one item. 

I am trying to run stateless where I can.  So the question is do I need to 
make the productId property of the Details page a persistant one (with 
session scope), or am I considered within the overall lifecycle for the 
page? 

The reason for my confusion is, that by the time the listener has fired, the 
response has come back from the user (so the productID has been stored in 
the URL as a parameter to the listener) but since the page has not yet 
started rendering I assumed all its property variables would get themselves 
initialised to their initial value. 


 --
Alan Chandler
alan@chandlerfamily.org.uk

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


Re: Persistance or not?

Posted by Paul Cantrell <ca...@pobox.com>.
I'm writing a mostly-stateless app, and in it I often do similar  
things -- in your example, Details would have an init(productId)  
method, and doShowDetails() would call details.init(productId).

It works just fine, as far as I can tell.


On Aug 24, 2005, at 9:03 AM, Alan Chandler wrote:

> The example in the tap4 user guide on page injection gives the  
> following example
> <inject property="detailsPage" type="page" object="Details"/>
> public abstract Details getDetailsPage();
>
> public IPage doShowDetails(long productId)
> {
>   Details details = getDetailsPage();
>
>   details.setProductId(productId);
>
>   return details;
> }
>
> This is almost exactly what I want to do, with my little database  
> application as I allow the user to move from a summary list to the  
> details page for one item.
> I am trying to run stateless where I can.  So the question is do I  
> need to make the productId property of the Details page a  
> persistant one (with session scope), or am I considered within the  
> overall lifecycle for the page?
> The reason for my confusion is, that by the time the listener has  
> fired, the response has come back from the user (so the productID  
> has been stored in the URL as a parameter to the listener) but  
> since the page has not yet started rendering I assumed all its  
> property variables would get themselves initialised to their  
> initial value.
>
> --
> Alan Chandler
> alan@chandlerfamily.org.uk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>

_________________________________________________________________

"Prediction is hard, especially of the future."  -- Niels Bohr


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