--- On Wed, 7/30/08, Nick Scavelli <[EMAIL PROTECTED]> wrote:
> I'm replying to this because it's somewhat related
> to an issue I'm having.

Not really :p

> Let's say I have the following control in my jsp:
> <sx:submit type="button" method="search" value="Search"
>            targets="resultsDiv" indicator="indicator"/>
> 
> But let's say my session has timed out, and I need to redirect to the 
> login page.  In my circumstance the div is replaced by the login jsp,
> which just looks strange.  What are the best practices with dealing with
> these situations using Ajax.

I'm not sure what the *best* practice is, but one solution is to write an 
interceptor that checks if a request is an XHR. If it is, and the session is 
gone (or whatever other criteria is necessary), send back a 302 and the name of 
a global result (that's what we've done here, anyway). Even though it's an XHR 
the browser will redirect before the request gets back to your code--in essence 
making the request non-back-channel anymore.

(I'm not entirely convinced that behavior is reasonable, but it's a browser 
thing, so hey.)

Dave


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

Reply via email to