Thanks Thiago, its good to know its not using serialization, but the question 
remains, how does onPassivate retain those values? as far as I can tell that 
only leaves the request, anybody?

thanks,
Peter

----- Original Message -----
From: "Thiago H. de Paula Figueiredo" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Tuesday, 4 November, 2008 4:46:25 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: Re: Best practice for onActivate and onPassivate without persistence

Em Tue, 04 Nov 2008 09:31:36 -0300, Peter Stavrinides  
<[EMAIL PROTECTED]> escreveu:

> Hi everyone,

Hi!

> I was wandering about best practice for passing multiple parameters to a  
> page without using persist in the mix. Take the following example:
>
> void onActivate(Integer companyId, Integer siteId) throws SQLException {
>     _site = getSite(companyId,siteId);
> }
>
> CompanySite onPassivate(){
>       return _site;
> }     
>
> This works okay for my purposes... I like it because its stateless,  
> however is CompanySite being serialized underneath?

AFAIK, no.

> String onPassivate(){
>    return _site.getCId() + "/" + _site.getSiteId();
> }     

It wouldn't work. Tapestry would handle it as a single String and scape  
the / character. Then, your onActivate method, as written above, wouldn't  
work. You should return an Object[] or List instead:

Object onPassivate(){
     return new Object[] {_site.getCId(), + _site.getSiteId()};
}       

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


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

Reply via email to