[undertow-dev] PathHandler and HANDLE_404,HANDLE_500

Efraim Gentil efraim.gentil at gmail.com
Mon Nov 17 21:59:05 EST 2014


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 <https://twitter.com/efraimgentil>
Github <https://github.com/efraimgentil>
LinkedIn
<http://www.linkedin.com/profile/view?id=215608595&trk=nav_responsive_tab_profile_pic>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20141117/9fcd8f07/attachment-0001.html 


More information about the undertow-dev mailing list