Have a look at io.undertow.server.handlers.error.FileErrorPageHandler.
Basically you can use io.undertow.server.HttpServerExchange#addDefaultResponseListener to generate default responses.
Stuart
> _______________________________________________
----- Original Message -----
> From: "Efraim Gentil" <efraim.gentil@gmail.com>
> To: undertow-dev@lists.jboss.org
> Sent: Tuesday, 18 November, 2014 1:59:05 PM
> Subject: [undertow-dev] PathHandler and HANDLE_404,HANDLE_500
>
>
>
> Hi guys, i’m working on some specs in my app and i’m trying to specify a 404
> error handler and 500 error handler in my PathHandler, apparently that’s not
> possible, i tried to use default handler as
> Handles.path(//MyDefaultHandlerHere), for 404 handler works fine, but what
> about 500 error handler ? there is any way to specify this ?
>
> Simple test:
> Undertow.builder().addHttpListener( 8080 , "localhost" )
> .setHandler(path( new HttpHandler() { public void handleRequest
> (HttpServerExchange exchange) throws Exception {
> System.out.println( "DEFAULT" );
> }
> })
> .addExactPath( "/hi" , new HttpHandler() { public void handleRequest
> (HttpServerExchange exchange) throws Exception {
> System.out.println( "HI" );
> }})
> .addExactPath( "/hi2" , new HttpHandler() { public void handleRequest
> (HttpServerExchange exchange) throws Exception {
> System.out.println( "HI2" ); throw new RuntimeException () ;
> }})
> ).build();
>
>
> Maybe in the builder we can have something like
> Undertow.builder()
> .setNotFoundHandler( notFoundHandlerImpl )
> .setServerErrorHandler( serverErrorHandlerImpl )
> ...
>
> Thanks
>
> --
> Atenciosamente,
> Efraim Gentil - @efraimgentil
> Github
>
>
> undertow-dev mailing list
> undertow-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev