Hi Jack

Firstly if validation fails for a form, you shouldn't be redirected therefore 
you need not worry about that, the redirect after the post should occur if 
validation succeeds. 
 
A side note: I agree if you want a scalable web application that heavy use of 
the session is not desirable, however Tapestry has the means to avoid / work 
around this. A pattern you should use in your pages, rather than ASO's, is 
onActivate and onPassivate. See: 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html. Then by 
passing an integer (a pkey for instance) to the page you can reinitialize your 
DOA as desired in @SetupRender. Also, even if you loose form data for some 
reason, you can use onPrepare to initialize the form using this pattern:
onPrepare(){
 if(formDAO == null)
  initFormDAO(pkey);
}

What makes using sessions less scalable is the load they place on the web 
server, but if you keep them very lite (I store only an id or two that should 
always be available) then there is really no scalability penalty. When I do 
need to use the session, I hardly ever use persist, I prefer Persist("flash") 
so far as possible, as this removes the object from the session immediately 
after its used.

cheers,
Peter


----- Original Message -----
From: "Jack Nuzbit" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Thursday, 16 October, 2008 5:31:40 PM GMT +02:00 Athens, Beirut, 
Bucharest, Istanbul
Subject: tapestry 5 without sessions

I'm about to start a large project and intend to use tapestry 5 but want to
avoid using sessions due to scalability.  The only issue I can see is losing
form data when the validation fails because of the redirect after the post.

I've noticed the property tapestry.suppress-redirect-from-action-requests
but in general I prefer this behaviour so I'd rather not use this if there
is an alternative. Plus the documentation says 'This option should be used
with care' which makes me nervous about using it at all.

The only time I don't want a redirect occurring is when validation fails and
form data needs to be presented back to the user without being persisted. Is
there a way to do this because being forced to use session just for this
reason doesn't seem worthwhile.

I'm wondering what other peoples thoughts and approaches were to this
problem.
Has anyone used tapestry5 without sessions?


Cheers,

Jack

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

Reply via email to