public void handle ( Request request , Response response ) throws Exception { if ( Environment . isDevelopment ( ) ) { this . middlewares = this . middlewareFactory . create ( ) ; } try { handle ( request , response , new ArrayList < Middleware > ( Arrays . asList ( middlewares ) ) ) ; } catch ( Exception e ) { if ( exceptionHandler != null ) { exceptionHandler . handle ( e , request , response ) ; } else { throw e ; } } }
Handles an HTTP request by delgating the call to the middlewares .