It looks promising! Thanks!

The only bad thing is that my request didn't even reach the T5 Filter... 
because the systems needs another filter (http servlet filter) for 
anthentication and authorization... It will need some workaround...

Thanks!

Everton



________________________________
De: Moritz Gmelin <moritz.gme...@gmx.de>
Para: Tapestry users <users@tapestry.apache.org>
Enviadas: Terça-feira, 19 de Janeiro de 2010 5:23:08
Assunto: Re: Chenille Kit - Handle response error

Hi,

we've solved this issue just yesterday with a custom AccessControlDispatcher. 
Works great for inPlace grids and other zone update stuff.

Add this to your AppModule

    public void contributeMasterDispatcher(
                    OrderedConfiguration<Dispatcher> configuration,
                    @InjectService("AccessControlDispatcher") Dispatcher 
accessController)
    {
        configuration.add("AccessControlDispatcher", accessController,
            "before:ComponentEvent");
    }

and then, in your AccessControlDispatcher, check whether the session is still 
available. If it is not, and the request is an Ajax Request, return a 
javascript to reload the page or to go somewhere else

    public boolean dispatch(Request request, Response response)
        throws IOException
    {

            //do some other stuff here to check for the session availability
    
            if (noSession && request.isXHR())
            {
                OutputStream os = 
response.getOutputStream("application/json;charset=UTF-8");
                
os.write("{\"script\":\"window.location.reload();\"}".getBytes());
                os.flush();
                return true;
            }
    }


Hope this helps.

Regards

Moritz



Am 18.01.2010 um 22:54 schrieb Everton Agner:

> Hi,
> 
> I know this isn't a Mailing list about Chenille, but i believe it's kind of a 
> commom subject.
> 
> Well... When I have a page that has, for instance, a TabSet and my session 
> expires while it is opened, when the user choose to change the Tab, the Ajax 
> request made to the server returns no response (tecnically, i made it return 
> a 401 error), but there is no JSON value, so that black popup window from 
> Chenille will open up with the error.
> 
> There is any way I can handle that? Making the no-response ajax request from 
> Chenille redirect to my login page?
> 
> Thanks,
> 
> Everton
> 
> 
> 
>      
> ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com


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


      
____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Reply via email to