You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Kamau <jo...@gmail.com> on 2010/11/09 17:11:13 UTC

@Persist vs onActivate/OnPassivate

Hi team;

1. What is the difference between using @Persist and using the
activate/passivate pairs? are they always interchangeable as a means of
passing a value from one page to another?

2. When @Persist is used, is the value stored in the session? and at what
point is it "cleaned up" . Is there a possibility of bloating the session
when using @Persist?

its likely that my questions may not even be valid. please advise
accordingly.
Thanks

regards.
Josh

Re: @Persist vs onActivate/OnPassivate

Posted by Katia Aresti <ka...@gmail.com>.
Hi Josh,

You will find all the information concerning @Persist annotation here (which
stores data in the session) :

http://tapestry.apache.org/tapestry5.2-dev/guide/persist.html

and here about onActivate / onPasivate :
http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html<%20http://tapestry.apache.org/tapestry5.2-dev/guide/pagenav.html>

And finally, I strongly recommend you to read this article to. You might had
already read it, but I strongly recommend to you to read it carefully again
:
http://www.infoq.com/articles/tapestry5-intro

No offences, but even if you might think that Tapestry documentation is not
good, I'm under the impression you don't search enough on it. Most of the
questions can be answered just reading the documentation, google, the blogs
I told you (Igor, Howard, Christophe+Robin), or just google, and jumpstart.

I understand this list is very useful, but please, search a little more by
yourself.  You will figure out better where the documentation is, and where
to find the answers.

As I said, no offences.

Best regards,

Katia



2010/11/9 Josh Kamau <jo...@gmail.com>

> Hi team;
>
> 1. What is the difference between using @Persist and using the
> activate/passivate pairs? are they always interchangeable as a means of
> passing a value from one page to another?
>
> 2. When @Persist is used, is the value stored in the session? and at what
> point is it "cleaned up" . Is there a possibility of bloating the session
> when using @Persist?
>
> its likely that my questions may not even be valid. please advise
> accordingly.
> Thanks
>
> regards.
> Josh
>

Re: @Persist vs onActivate/OnPassivate

Posted by Richard Hill <ri...@su3analytics.com>.
Great, thanks. FFR, this is how I have implemented:

.java:

@Inject
private PageRenderLinkSource plrs;

public Link getLink() {
  Link link = plrs.createPageRenderLink(MyPage.class);
  link.addParameter("q", "test"); 
  return link;
}


.tml:

<a href="${link}">my page link</a>


Seems to work :)




-----Original Message-----
From: Thiago H. de Paula Figueiredo <th...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: @Persist vs onActivate/OnPassivate
Date: Thu, 11 Nov 2010 13:00:45 -0200

On Thu, 11 Nov 2010 12:55:51 -0200, Richard Hill <ri...@su3analytics.com>  
wrote:

> One thing that would be great is a way to create an internal link with
> request parameters. Your example shows how to do via a POST, I'd like to
> implement a GET link instead. Something like
> <t:pagelink page="mypage" context="blah">mypage</t:pagelink>
> but instead of activation context, request parameters.

I like the idea of PageLink having both activation context and query  
parameters. :)

PageLink doesn't support it yet, but you can generate a Link for it using  
the PageRenderLinkSource service and the add the query parameters to it.




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


Re: @Persist vs onActivate/OnPassivate

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 11 Nov 2010 12:55:51 -0200, Richard Hill <ri...@su3analytics.com>  
wrote:

> One thing that would be great is a way to create an internal link with
> request parameters. Your example shows how to do via a POST, I'd like to
> implement a GET link instead. Something like
> <t:pagelink page="mypage" context="blah">mypage</t:pagelink>
> but instead of activation context, request parameters.

I like the idea of PageLink having both activation context and query  
parameters. :)

PageLink doesn't support it yet, but you can generate a Link for it using  
the PageRenderLinkSource service and the add the query parameters to it.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: @Persist vs onActivate/OnPassivate

Posted by Richard Hill <ri...@su3analytics.com>.
One thing that would be great is a way to create an internal link with
request parameters. Your example shows how to do via a POST, I'd like to
implement a GET link instead. Something like

<t:pagelink page="mypage" context="blah">mypage</t:pagelink>

but instead of activation context, request parameters.

Any idea how to do this?




-----Original Message-----
From: Geoff Callender <ge...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: @Persist vs onActivate/OnPassivate
Date: Thu, 11 Nov 2010 00:51:42 +1100

Hmmm, so I guess this examples page of "Passing Data Between Pages" isn't meeting the need:

	http://jumpstart.doublenegative.com.au/jumpstart/examples/state/passingdatabetweenpages1

Suggestions welcome.

Cheers,

Geoff


On 11/11/2010, at 12:06 AM, Nicolas Barrera wrote:

> +1 for the best practices page
> 
> Nicolás.-
> 
> 
> 2010/11/9 françois facon <fr...@gmail.com>
> 
>> Passivate will also generate clean and *Bookmarkable* URL for you.
>> 
>> Activate/ passivate will reduce memory use and increase performance in
>> server side.
>> because Creating session cost a lot and require memory.
>> 
>> by using @Persist, you will generate at east one more request to initialize
>> your data.
>> 
>> About documentation, there is perhaps a need for a page that define the
>> best
>> pratices for T5.
>> 
>> 
>> 
>> 2010/11/9 Andreas Andreou <an...@di.uoa.gr>
>> 
>>>> It's flash, not flush. :)
>>> 
>>> That's a great idea for an easter-egg there!
>>> 
>>> 
>>>> --
>>>> Thiago H. de Paula Figueiredo
>>>> Independent Java, Apache Tapestry 5 and Hibernate consultant,
>> developer,
>>> and
>>>> instructor
>>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>>> http://www.arsmachina.com.br
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>>> Tapestry PMC / Tacos developer
>>> Open Source / JEE Consulting
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>>> 
>> 


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




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


Re: @Persist vs onActivate/OnPassivate

Posted by Geoff Callender <ge...@gmail.com>.
The link http://jumpstart.doublenegative.com.au/jumpstart/examples/easycrud
has now been replaced by:

	http://jumpstart.doublenegative.com.au/jumpstart/previews/easycrud/persons

On 11/11/2010, at 9:29 PM, françois facon wrote:

> Hi Geoff,
> 
> Thank you again for Jumpstart. It help so much.
> 
> my 2 rupies.
> 
> for the page PassingDataBetweenPages1, I was about to  suggest  to replace
> the form use to access page2 (Activation Context) by a pagelink.  But I
> realise that,
> PassingDataBetweenPages1 is just the perfect exemple when navigation occured
> 
> after form submission.
> 
> During Tapestry Code review, we often notice that people who have previous
> experience in using jsp
> are more likely to use @Persist for navigation in crud page
> (http://jumpstart.doublenegative.com.au/jumpstart/examples/easycrud).
> So they miss the Activate Passivate interest.
> + stateless page (less memory usage)
> + clean and bookmarkable url
> + less request
> 
> Like
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/pagelinkoractionlink
> perhaps there is need to a page called persitoractivate.
> 
> François
> 
> 2010/11/10 Geoff Callender <ge...@gmail.com>
> 
>> Hmmm, so I guess this examples page of "Passing Data Between Pages" isn't
>> meeting the need:
>> 
>> 
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/state/passingdatabetweenpages1
>> 
>> Suggestions welcome.
>> 
>> Cheers,
>> 
>> Geoff
>> 
>> 
>> On 11/11/2010, at 12:06 AM, Nicolas Barrera wrote:
>> 
>>> +1 for the best practices page
>>> 
>>> Nicolás.-
>>> 
>>> 
>>> 2010/11/9 françois facon <fr...@gmail.com>
>>> 
>>>> Passivate will also generate clean and *Bookmarkable* URL for you.
>>>> 
>>>> Activate/ passivate will reduce memory use and increase performance in
>>>> server side.
>>>> because Creating session cost a lot and require memory.
>>>> 
>>>> by using @Persist, you will generate at east one more request to
>> initialize
>>>> your data.
>>>> 
>>>> About documentation, there is perhaps a need for a page that define the
>>>> best
>>>> pratices for T5.
>>>> 
>>>> 
>>>> 
>>>> 2010/11/9 Andreas Andreou <an...@di.uoa.gr>
>>>> 
>>>>>> It's flash, not flush. :)
>>>>> 
>>>>> That's a great idea for an easter-egg there!
>>>>> 
>>>>> 
>>>>>> --
>>>>>> Thiago H. de Paula Figueiredo
>>>>>> Independent Java, Apache Tapestry 5 and Hibernate consultant,
>>>> developer,
>>>>> and
>>>>>> instructor
>>>>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>>>>> http://www.arsmachina.com.br
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>>>>> Tapestry PMC / Tacos developer
>>>>> Open Source / JEE Consulting
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>> 
>>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 


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


Re: @Persist vs onActivate/OnPassivate

Posted by françois facon <fr...@gmail.com>.
Hi Geoff,

Thank you again for Jumpstart. It help so much.

my 2 rupies.

for the page PassingDataBetweenPages1, I was about to  suggest  to replace
the form use to access page2 (Activation Context) by a pagelink.  But I
realise that,
PassingDataBetweenPages1 is just the perfect exemple when navigation occured

after form submission.

During Tapestry Code review, we often notice that people who have previous
experience in using jsp
are more likely to use @Persist for navigation in crud page
(http://jumpstart.doublenegative.com.au/jumpstart/examples/easycrud).
So they miss the Activate Passivate interest.
+ stateless page (less memory usage)
+ clean and bookmarkable url
+ less request

Like
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/pagelinkoractionlink
perhaps there is need to a page called persitoractivate.

François

2010/11/10 Geoff Callender <ge...@gmail.com>

> Hmmm, so I guess this examples page of "Passing Data Between Pages" isn't
> meeting the need:
>
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/state/passingdatabetweenpages1
>
> Suggestions welcome.
>
> Cheers,
>
> Geoff
>
>
> On 11/11/2010, at 12:06 AM, Nicolas Barrera wrote:
>
> > +1 for the best practices page
> >
> > Nicolás.-
> >
> >
> > 2010/11/9 françois facon <fr...@gmail.com>
> >
> >> Passivate will also generate clean and *Bookmarkable* URL for you.
> >>
> >> Activate/ passivate will reduce memory use and increase performance in
> >> server side.
> >> because Creating session cost a lot and require memory.
> >>
> >> by using @Persist, you will generate at east one more request to
> initialize
> >> your data.
> >>
> >> About documentation, there is perhaps a need for a page that define the
> >> best
> >> pratices for T5.
> >>
> >>
> >>
> >> 2010/11/9 Andreas Andreou <an...@di.uoa.gr>
> >>
> >>>> It's flash, not flush. :)
> >>>
> >>> That's a great idea for an easter-egg there!
> >>>
> >>>
> >>>> --
> >>>> Thiago H. de Paula Figueiredo
> >>>> Independent Java, Apache Tapestry 5 and Hibernate consultant,
> >> developer,
> >>> and
> >>>> instructor
> >>>> Owner, Ars Machina Tecnologia da Informação Ltda.
> >>>> http://www.arsmachina.com.br
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> >>> Tapestry PMC / Tacos developer
> >>> Open Source / JEE Consulting
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: @Persist vs onActivate/OnPassivate

Posted by Geoff Callender <ge...@gmail.com>.
Hmmm, so I guess this examples page of "Passing Data Between Pages" isn't meeting the need:

	http://jumpstart.doublenegative.com.au/jumpstart/examples/state/passingdatabetweenpages1

Suggestions welcome.

Cheers,

Geoff


On 11/11/2010, at 12:06 AM, Nicolas Barrera wrote:

> +1 for the best practices page
> 
> Nicolás.-
> 
> 
> 2010/11/9 françois facon <fr...@gmail.com>
> 
>> Passivate will also generate clean and *Bookmarkable* URL for you.
>> 
>> Activate/ passivate will reduce memory use and increase performance in
>> server side.
>> because Creating session cost a lot and require memory.
>> 
>> by using @Persist, you will generate at east one more request to initialize
>> your data.
>> 
>> About documentation, there is perhaps a need for a page that define the
>> best
>> pratices for T5.
>> 
>> 
>> 
>> 2010/11/9 Andreas Andreou <an...@di.uoa.gr>
>> 
>>>> It's flash, not flush. :)
>>> 
>>> That's a great idea for an easter-egg there!
>>> 
>>> 
>>>> --
>>>> Thiago H. de Paula Figueiredo
>>>> Independent Java, Apache Tapestry 5 and Hibernate consultant,
>> developer,
>>> and
>>>> instructor
>>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>>> http://www.arsmachina.com.br
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
>>> Tapestry PMC / Tacos developer
>>> Open Source / JEE Consulting
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>>> 
>> 


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


Re: @Persist vs onActivate/OnPassivate

Posted by Nicolas Barrera <nb...@gmail.com>.
+1 for the best practices page

Nicolás.-


2010/11/9 françois facon <fr...@gmail.com>

> Passivate will also generate clean and *Bookmarkable* URL for you.
>
> Activate/ passivate will reduce memory use and increase performance in
> server side.
> because Creating session cost a lot and require memory.
>
> by using @Persist, you will generate at east one more request to initialize
> your data.
>
> About documentation, there is perhaps a need for a page that define the
> best
> pratices for T5.
>
>
>
> 2010/11/9 Andreas Andreou <an...@di.uoa.gr>
>
> > > It's flash, not flush. :)
> >
> > That's a great idea for an easter-egg there!
> >
> >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > and
> > > instructor
> > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> > Tapestry PMC / Tacos developer
> > Open Source / JEE Consulting
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: @Persist vs onActivate/OnPassivate

Posted by françois facon <fr...@gmail.com>.
Passivate will also generate clean and *Bookmarkable* URL for you.

Activate/ passivate will reduce memory use and increase performance in
server side.
because Creating session cost a lot and require memory.

by using @Persist, you will generate at east one more request to initialize
your data.

About documentation, there is perhaps a need for a page that define the best
pratices for T5.



2010/11/9 Andreas Andreou <an...@di.uoa.gr>

> > It's flash, not flush. :)
>
> That's a great idea for an easter-egg there!
>
>
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and
> > instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> --
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry PMC / Tacos developer
> Open Source / JEE Consulting
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: @Persist vs onActivate/OnPassivate

Posted by Andreas Andreou <an...@di.uoa.gr>.
> It's flash, not flush. :)

That's a great idea for an easter-egg there!


> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry PMC / Tacos developer
Open Source / JEE Consulting

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


Re: @Persist vs onActivate/OnPassivate

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 09 Nov 2010 15:13:46 -0200, Josh Kamau <jo...@gmail.com>  
wrote:

> the website. Lets take what i just asked for example. I read about
> activation , passivation and @Persist , i am able to use either to pass
> values across pages. Then i asked my self, if both methods are working,  
> then which should i use where? And what was the intention for each? So i  
> asked
> here.

This question was a very interesting one. There were some others that I  
were answered with "read this page in the documentation". My suggestion is  
to check documentation first, then the mailing list and committer blogs,  
then search engines, then the mailing list if doubts remain.

> If i hadnt asked, i wouldnt have learnt about @Persist("flush") .

It's flash, not flush. :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: @Persist vs onActivate/OnPassivate

Posted by Josh Kamau <jo...@gmail.com>.
@Katie;

I am doing alot of reading and am almost done implementing and application
that include spring and hibernate application. I have been able to figure
quite alot on my own as well as reading the T5 book blogs and the docs at
the website. Lets take what i just asked for example. I read about
activation , passivation and @Persist , i am able to use either to pass
values across pages. Then i asked my self, if both methods are working, then
which should i use where? And what was the intention for each? So i asked
here. Note that my application is aready working but am not comfortable
being able to do the same thing with 2 methods without understanding when to
use which.

If i hadnt asked, i wouldnt have learnt about @Persist("flush") .  My
altitude on the documentation changed long time ago and i can find most of
the things.

regards.

On Tue, Nov 9, 2010 at 12:05 PM, Katia Aresti <ka...@gmail.com> wrote:

> @Josh :
> I'm not the master of this list to tell what kind of questions are or not
> discouraged. Everybody makes trivial questions sometimes, I'm the first one
> to do it.
>
> The problem is when asking the question becomes the first thing to do
> before
> reading the documentation or searching by yourself.
> Commiters, PMC and community in general invert a lot of hours writing
> documentation, which is not the sexiest part of any project. You said
> Tapestry documentation is a lack, and that you might find this
> documentation
> poor or disorganized or whatever. But I showed you how a lot of questions
> you ask are already very well explained in documentation or in the blogs.
>
> When working on any project or tool, you must learn where the answers are.
> Tapestry, Wicket, Maven or MyGrandMothersProject
> That's why documentation exists. You must learn to use this documentation.
> And that's why lists exists, when the answer is very hard to find it out
> there... or when the answer doesn't exist.
>
> If you abuse of the list, people will finish be fed up.
>
> And as I said : no offences :)
>
> Katia
>
>
> 2010/11/9 Richard Hill <ri...@su3analytics.com>
>
> >
> > It's not, but within reason :)
> >
> > Personally I find it hard to sometimes find what I need in the docs, but
> > most basic stuff is reasonably covered if you hunt around. It's always
> > good to have a Google (making sure to avoid tap 4 results(!)) and/or
> > search the mailing list as lots of stuff has been covered. And it's
> > always quite interesting to do that as often I find some new tidbit
> > that's of later use.
> >
> >
> > -----Original Message-----
> > From: Josh Kamau <jo...@gmail.com>
> > Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> > To: Tapestry users <us...@tapestry.apache.org>
> > Subject: Re: @Persist vs onActivate/OnPassivate
> > Date: Tue, 9 Nov 2010 11:51:03 -0500
> >
> > Thanks all for the responses.  I have got my questions answered.
> >
> > @Katia
> > Is asking trivia questions discouraged? i didnt know. i will ask
> something
> > here only as the last resort.
> >
> > regards
> >
> > On Tue, Nov 9, 2010 at 11:42 AM, Thiago H. de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> > > On Tue, 09 Nov 2010 14:33:20 -0200, Richard Hill <
> rich@su3analytics.com>
> > > wrote:
> > >
> > >  @Persist stores the field value in the session, scoped to the page. It
> > >> will persist for the duration of the session. This will time-out per
> > >> whatever the default is for your servlet container. So yes if your
> > >> session time-out is lengthy and you have a lot of users over that
> time,
> > >> then yes what's in the session will add up.
> > >>
> > >
> > > Absolutely right. @Persist("flash") is a little bit different: after
> > being
> > > put in the session, the value is removed from when it's read for the
> > first
> > > time. It's ideal for redirect-after-post situations, specially forms.
> > >
> > >
> > >  You can have multiple onActivates with different numbers of arguments.
> > >> You can pass integers, doubles etc too as tapestry will attempt to
> > >> coerce the passed string values into the types specified in the
> > >> onActivate method().
> > >>
> > >
> > > It's correct, but I recommend having a single onActivate(EventContext
> > > context). It will be called for requests with any number of parameters.
> > > Tapestry converts the activation context values to various types using
> > > TypeCoercer, a Tapestry-IoC service. You can even your own conversions
> if
> > > needed.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: @Persist vs onActivate/OnPassivate

Posted by Katia Aresti <ka...@gmail.com>.
@Josh :
I'm not the master of this list to tell what kind of questions are or not
discouraged. Everybody makes trivial questions sometimes, I'm the first one
to do it.

The problem is when asking the question becomes the first thing to do before
reading the documentation or searching by yourself.
Commiters, PMC and community in general invert a lot of hours writing
documentation, which is not the sexiest part of any project. You said
Tapestry documentation is a lack, and that you might find this documentation
poor or disorganized or whatever. But I showed you how a lot of questions
you ask are already very well explained in documentation or in the blogs.

When working on any project or tool, you must learn where the answers are.
Tapestry, Wicket, Maven or MyGrandMothersProject
That's why documentation exists. You must learn to use this documentation.
And that's why lists exists, when the answer is very hard to find it out
there... or when the answer doesn't exist.

If you abuse of the list, people will finish be fed up.

And as I said : no offences :)

Katia


2010/11/9 Richard Hill <ri...@su3analytics.com>

>
> It's not, but within reason :)
>
> Personally I find it hard to sometimes find what I need in the docs, but
> most basic stuff is reasonably covered if you hunt around. It's always
> good to have a Google (making sure to avoid tap 4 results(!)) and/or
> search the mailing list as lots of stuff has been covered. And it's
> always quite interesting to do that as often I find some new tidbit
> that's of later use.
>
>
> -----Original Message-----
> From: Josh Kamau <jo...@gmail.com>
> Reply-to: "Tapestry users" <us...@tapestry.apache.org>
> To: Tapestry users <us...@tapestry.apache.org>
> Subject: Re: @Persist vs onActivate/OnPassivate
> Date: Tue, 9 Nov 2010 11:51:03 -0500
>
> Thanks all for the responses.  I have got my questions answered.
>
> @Katia
> Is asking trivia questions discouraged? i didnt know. i will ask something
> here only as the last resort.
>
> regards
>
> On Tue, Nov 9, 2010 at 11:42 AM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> > On Tue, 09 Nov 2010 14:33:20 -0200, Richard Hill <ri...@su3analytics.com>
> > wrote:
> >
> >  @Persist stores the field value in the session, scoped to the page. It
> >> will persist for the duration of the session. This will time-out per
> >> whatever the default is for your servlet container. So yes if your
> >> session time-out is lengthy and you have a lot of users over that time,
> >> then yes what's in the session will add up.
> >>
> >
> > Absolutely right. @Persist("flash") is a little bit different: after
> being
> > put in the session, the value is removed from when it's read for the
> first
> > time. It's ideal for redirect-after-post situations, specially forms.
> >
> >
> >  You can have multiple onActivates with different numbers of arguments.
> >> You can pass integers, doubles etc too as tapestry will attempt to
> >> coerce the passed string values into the types specified in the
> >> onActivate method().
> >>
> >
> > It's correct, but I recommend having a single onActivate(EventContext
> > context). It will be called for requests with any number of parameters.
> > Tapestry converts the activation context values to various types using
> > TypeCoercer, a Tapestry-IoC service. You can even your own conversions if
> > needed.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: @Persist vs onActivate/OnPassivate

Posted by Richard Hill <ri...@su3analytics.com>.
It's not, but within reason :)

Personally I find it hard to sometimes find what I need in the docs, but
most basic stuff is reasonably covered if you hunt around. It's always
good to have a Google (making sure to avoid tap 4 results(!)) and/or
search the mailing list as lots of stuff has been covered. And it's
always quite interesting to do that as often I find some new tidbit
that's of later use.


-----Original Message-----
From: Josh Kamau <jo...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: @Persist vs onActivate/OnPassivate
Date: Tue, 9 Nov 2010 11:51:03 -0500

Thanks all for the responses.  I have got my questions answered.

@Katia
Is asking trivia questions discouraged? i didnt know. i will ask something
here only as the last resort.

regards

On Tue, Nov 9, 2010 at 11:42 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 09 Nov 2010 14:33:20 -0200, Richard Hill <ri...@su3analytics.com>
> wrote:
>
>  @Persist stores the field value in the session, scoped to the page. It
>> will persist for the duration of the session. This will time-out per
>> whatever the default is for your servlet container. So yes if your
>> session time-out is lengthy and you have a lot of users over that time,
>> then yes what's in the session will add up.
>>
>
> Absolutely right. @Persist("flash") is a little bit different: after being
> put in the session, the value is removed from when it's read for the first
> time. It's ideal for redirect-after-post situations, specially forms.
>
>
>  You can have multiple onActivates with different numbers of arguments.
>> You can pass integers, doubles etc too as tapestry will attempt to
>> coerce the passed string values into the types specified in the
>> onActivate method().
>>
>
> It's correct, but I recommend having a single onActivate(EventContext
> context). It will be called for requests with any number of parameters.
> Tapestry converts the activation context values to various types using
> TypeCoercer, a Tapestry-IoC service. You can even your own conversions if
> needed.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



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


Re: @Persist vs onActivate/OnPassivate

Posted by Josh Kamau <jo...@gmail.com>.
Thanks all for the responses.  I have got my questions answered.

@Katia
Is asking trivia questions discouraged? i didnt know. i will ask something
here only as the last resort.

regards

On Tue, Nov 9, 2010 at 11:42 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 09 Nov 2010 14:33:20 -0200, Richard Hill <ri...@su3analytics.com>
> wrote:
>
>  @Persist stores the field value in the session, scoped to the page. It
>> will persist for the duration of the session. This will time-out per
>> whatever the default is for your servlet container. So yes if your
>> session time-out is lengthy and you have a lot of users over that time,
>> then yes what's in the session will add up.
>>
>
> Absolutely right. @Persist("flash") is a little bit different: after being
> put in the session, the value is removed from when it's read for the first
> time. It's ideal for redirect-after-post situations, specially forms.
>
>
>  You can have multiple onActivates with different numbers of arguments.
>> You can pass integers, doubles etc too as tapestry will attempt to
>> coerce the passed string values into the types specified in the
>> onActivate method().
>>
>
> It's correct, but I recommend having a single onActivate(EventContext
> context). It will be called for requests with any number of parameters.
> Tapestry converts the activation context values to various types using
> TypeCoercer, a Tapestry-IoC service. You can even your own conversions if
> needed.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: @Persist vs onActivate/OnPassivate

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 09 Nov 2010 14:33:20 -0200, Richard Hill <ri...@su3analytics.com>  
wrote:

> @Persist stores the field value in the session, scoped to the page. It
> will persist for the duration of the session. This will time-out per
> whatever the default is for your servlet container. So yes if your
> session time-out is lengthy and you have a lot of users over that time,
> then yes what's in the session will add up.

Absolutely right. @Persist("flash") is a little bit different: after being  
put in the session, the value is removed from when it's read for the first  
time. It's ideal for redirect-after-post situations, specially forms.

> You can have multiple onActivates with different numbers of arguments.
> You can pass integers, doubles etc too as tapestry will attempt to
> coerce the passed string values into the types specified in the
> onActivate method().

It's correct, but I recommend having a single onActivate(EventContext  
context). It will be called for requests with any number of parameters.
Tapestry converts the activation context values to various types using  
TypeCoercer, a Tapestry-IoC service. You can even your own conversions if  
needed.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: @Persist vs onActivate/OnPassivate

Posted by Richard Hill <ri...@su3analytics.com>.
@Persist stores the field value in the session, scoped to the page. It
will persist for the duration of the session. This will time-out per
whatever the default is for your servlet container. So yes if your
session time-out is lengthy and you have a lot of users over that time,
then yes what's in the session will add up.

Arguments to onActivate() are used to access the page context, that is
parameters passed in the url *path* (as opposed to query params ?q=
etc). Obviously this does not contribute to the session. E.g if you had
a page MyPage and you wanted to pass the value "hello" to it, you'd hit:

http://..../MyPage/hello

and in MyPage:


private String message;

public void onActivate(String message) {
   this.message = message;
}
 

You can have multiple onActivates with different numbers of arguments.
You can pass integers, doubles etc too as tapestry will attempt to
coerce the passed string values into the types specified in the
onActivate method().

Generally onActivate() is used only for a) accessing and parameters
passed to the page and b) possibly checking for user authentication or
something, so you can issue a redirect before page rendering.



-----Original Message-----
From: Josh Kamau <jo...@gmail.com>
Reply-to: "Tapestry users" <us...@tapestry.apache.org>
To: Tapestry users <us...@tapestry.apache.org>
Subject: @Persist vs onActivate/OnPassivate
Date: Tue, 9 Nov 2010 11:11:13 -0500

Hi team;

1. What is the difference between using @Persist and using the
activate/passivate pairs? are they always interchangeable as a means of
passing a value from one page to another?

2. When @Persist is used, is the value stored in the session? and at what
point is it "cleaned up" . Is there a possibility of bloating the session
when using @Persist?

its likely that my questions may not even be valid. please advise
accordingly.
Thanks

regards.
Josh



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