Hi

I was facing the same problem. What I did is a hack but it works wonders for me

In the tapestry.js file

                        onSuccess : function(response, jsonResponse) {
                                
                                /*
                                 * When the page is unloaded, pending Ajax 
requests appear to
                                 * terminate as successful (but with no reply 
value). Since
                                 * we're trying to navigate to a new page 
anyway, we just ignore
                                 * those false success callbacks. We have a 
listener for the
                                 * window's "beforeunload" event that sets this 
flag.
                                 */
                                if (Tapestry.windowUnloaded)
                                        return;
                                
                                /*
                                 * Prototype treats status == 0 as success, 
even though it seems
                                 * to mean the server didn't respond.
                                 */
                                if (!response.getStatus() || 
!response.request.success()) {
                                        
Tapestry.error(Tapestry.Messages.ajaxRequestUnsuccessful);
                                        return;
                                }

                                /**************** THIS IS THE PART I
ADDED **************************/
                                
if(response.getHeader("Content-type").indexOf("text/html") == 0 &&
                                                
response.responseText.indexOf("<!DOCTYPE") == 0){
                                        
                                        alert("Session expired. Please login 
again");
                                        window.location.href = 
"/sessionexpired"; //redirect to some page
                                        return;
                                }
                                 /**************** THIS IS THE PART I ADDED 
**************************/
                                
                                try {
                                        /* Re-invoke the success handler, 
capturing any exceptions. */
                                        successHandler.call(this, response, 
jsonResponse);
                                } catch (e) {
                                        finalOptions.onException.call(this, 
ajaxRequest, e);
                                }
                        }
                });

regards
Taha


On Tue, Jul 26, 2011 at 6:44 PM, George Christman
<gchrist...@cardaddy.com> wrote:
> Hello, I'm looking to redirect my page to the login page when the user tries
> to render a Tapestry Zone with an expired session. Does anybody have a good
> solution for this scenario?
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-tp4634714p4634714.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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

Reply via email to