Thanks Thiago. I will try all these options and report the results.
On Sep 14, 2011, at 5:19 PM, "Thiago H. de Paula Figueiredo" <thiag...@gmail.com> wrote: > On Wed, 14 Sep 2011 16:25:14 -0300, Lenny Primak <lpri...@hope.nyc.ny.us> > wrote: > >> This is a design/best practices question. >> We set up @Persist fields inside @SetupRender method. >> When a session is invalid/expired and an Ajax event is called, >> All these fields at null. >> The question is if there is a better way to handle this situation than >> having to check for Null in every Ajax event method for every @Persist field? > > You don't need to check all of them, just whether Request.getSession(false) > returns null or not. > >> I was thinking that @SetupRender should be called in case of session >> expiration during Ajax call. > > I don't like this solution at all, as it uses a component event handler for > doing something completely unrelated to rendering. You can even write class > transformation to add some logic to be executed in AJAX requests when the > session isn't valid. Taha wrote something similar (the @XHR annotation) in > his Tapestry Magic blog: > http://tawus.wordpress.com/2011/04/16/tapestry-magic-2-ajax-with-graceful-degradation/. > > On the other hand, I guess it's possible to implement a service that notifies > listeners when the session is killed. I don't think it's possible to discern > between timeout and normal session invalidation. > > -- > 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org