本文整理了Java中ro.pippo.core.Application.getRoutePostDispatchListeners()
方法的一些代码示例,展示了Application.getRoutePostDispatchListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getRoutePostDispatchListeners()
方法的具体详情如下:
包路径:ro.pippo.core.Application
类名称:Application
方法名:getRoutePostDispatchListeners
暂无
代码示例来源:origin: pippo-java/pippo
/**
* Executes onPostDispatch of registered route post-dispatch listeners.
*
* @param request
* @param response
*/
protected void onPostDispatch(Request request, Response response) {
application.getRoutePostDispatchListeners().onPostDispatch(request, response);
}
代码示例来源:origin: pippo-java/pippo
application.getRoutePostDispatchListeners().add(metricsDispatchListener);
代码示例来源:origin: ro.pippo/pippo-metrics
application.getRoutePostDispatchListeners().add(metricsDispatchListener);
代码示例来源:origin: com.gitblit.fathom/fathom-rest
private void initializeApplication() {
// hook-up the Metrics dispatch listener
MetricsDispatchListener metricsDispatchListener = new MetricsDispatchListener(metricRegistry);
application.getRoutePreDispatchListeners().add(metricsDispatchListener);
application.getRoutePostDispatchListeners().add(metricsDispatchListener);
// set the RedirectException handler
application.getErrorHandler().setExceptionHandler(RedirectException.class, (exception, ctx) -> {
RedirectException redirectException = (RedirectException) exception;
if (!Strings.isNullOrEmpty(redirectException.getSessionUrlAttribute())) {
String requestUri = ctx.getRequest().getApplicationUriWithQuery();
ctx.setSession(redirectException.getSessionUrlAttribute(), requestUri);
}
ctx.redirect(redirectException.getPath());
});
// set the StatusCodeException handler
application.getErrorHandler().setExceptionHandler(StatusCodeException.class, (exception, ctx) -> {
StatusCodeException statusCodeException = (StatusCodeException) exception;
ctx.setLocal("message", statusCodeException.getMessage());
application.getErrorHandler().handle(statusCodeException.getStatusCode(), ctx);
});
}
代码示例来源:origin: gitblit/fathom
private void initializeApplication() {
// hook-up the Metrics dispatch listener
MetricsDispatchListener metricsDispatchListener = new MetricsDispatchListener(metricRegistry);
application.getRoutePreDispatchListeners().add(metricsDispatchListener);
application.getRoutePostDispatchListeners().add(metricsDispatchListener);
// set the RedirectException handler
application.getErrorHandler().setExceptionHandler(RedirectException.class, (exception, ctx) -> {
RedirectException redirectException = (RedirectException) exception;
if (!Strings.isNullOrEmpty(redirectException.getSessionUrlAttribute())) {
String requestUri = ctx.getRequest().getApplicationUriWithQuery();
ctx.setSession(redirectException.getSessionUrlAttribute(), requestUri);
}
ctx.redirect(redirectException.getPath());
});
// set the StatusCodeException handler
application.getErrorHandler().setExceptionHandler(StatusCodeException.class, (exception, ctx) -> {
StatusCodeException statusCodeException = (StatusCodeException) exception;
ctx.setLocal("message", statusCodeException.getMessage());
application.getErrorHandler().handle(statusCodeException.getStatusCode(), ctx);
});
}
内容来源于网络,如有侵权,请联系作者删除!