@Override public void handle(WebContext webContext) throws Exception { RouteContext context = new RouteContext(webContext.getRequest(), webContext.getResponse()); // if execution returns false then execution is interrupted String uri = context.uri(); Route route = webContext.getRoute(); if (null == route) { throw new NotFoundException(context.uri()); } // init route, request parameters, route action method and parameter. context.initRoute(route); // execution middleware if (hasMiddleware && !invokeMiddleware(routeMatcher.getMiddleware(), context)) { return; } context.injectParameters(); // web hook before if (hasBeforeHook && !invokeHook(routeMatcher.getBefore(uri), context)) { return; } // execute this.routeHandle(context); // webHook if (hasAfterHook) { this.invokeHook(routeMatcher.getAfter(uri), context); } }
@Override public void handle(WebContext webContext) throws Exception { RouteContext context = new RouteContext(webContext.getRequest(), webContext.getResponse()); // if execution returns false then execution is interrupted String uri = context.uri(); Route route = webContext.getRoute(); if (null == route) { throw new NotFoundException(context.uri()); } // init route, request parameters, route action method and parameter. context.initRoute(route); // execution middleware if (hasMiddleware && !invokeMiddleware(routeMatcher.getMiddleware(), context)) { return; } context.injectParameters(); // web hook before if (hasBeforeHook && !invokeHook(routeMatcher.getBefore(uri), context)) { return; } // execute this.routeHandle(context); // webHook if (hasAfterHook) { this.invokeHook(routeMatcher.getAfter(uri), context); } }
@Override public void handle(WebContext webContext) throws Exception { RouteContext context = new RouteContext(webContext.getRequest(), webContext.getResponse()); // if execution returns false then execution is interrupted String uri = context.uri(); Route route = webContext.getRoute(); if (null == route) { throw new NotFoundException(context.uri()); } // init route, request parameters, route action method and parameter. context.initRoute(route); // execution middleware if (hasMiddleware && !invokeMiddleware(routeMatcher.getMiddleware(), context)) { return; } context.injectParameters(); // web hook before if (hasBeforeHook && !invokeHook(routeMatcher.getBefore(uri), context)) { return; } // execute this.routeHandle(context); // webHook if (hasAfterHook) { this.invokeHook(routeMatcher.getAfter(uri), context); } }