Anyone?

To clarify, the scenario is this: client sends an AJAX event request to server 
where the user's session has timed out.

There is a workaround that works - it returns an object with property 
<code>_tapestry</code> with its value set to the old T5.3 object...

        os.write(("{\"_tapestry\":{\"redirectURL\":\"" + 
requestedPageLink.toAbsoluteURI() + "\"}}")
                                                .getBytes());

...but is that really what was intended, or is this a bug?

Cheers,

Geoff

On 09/11/2013, at 4:36 PM, Geoff Callender wrote:

> The technique I use in T5.3 isn't working in T5.4 (alpha-23 with jquery). Has 
> anyone else got it to work?
> 
> Server-side, I'm returning JSON response containing 
> <code>redirectURL</code>...
> 
>       OutputStream os = 
> response.getOutputStream("application/json;charset=UTF-8");
>       os.write(("{\"redirectURL\":\"" + requestedPageLink.toAbsoluteURI() + 
> "\"}").getBytes());
>       os.close();
> 
> …and client-side, the response is being handled in pageinit.js method 
> handlePartialPageRenderResponse.
> 
>         responseJSON = response.json || {};
>         partial = responseJSON._tapestry;
>         delete responseJSON._tapestry;
>         if (partial != null ? partial.redirectURL : void 0) {
>           window.location.href = partial.redirectURL;
>           return;
>         }
> 
> In debug I see that <code>response.json</code> holds redirectURL. That's 
> good. But <code>partial</code> is undefined so the redirect doesn't occur.
> 
> Is this a bug or have I missed something?
> 
> Cheers,
> 
> Geoff

Reply via email to