private void checkCommitted() { if (isCommitted()) { throw new PippoRuntimeException("The response has already been committed"); } }
if (routeContext.getResponse().isCommitted()) { log.debug("The response has already been committed. Cannot use the exception handler."); return;
if (!response.isCommitted()) { if (response.getStatus() == 0) { log.debug("Status code not set for {} '{}'", requestMethod, requestPath);
@Override public void handle(RouteContext routeContext) { String language = enableQueryParameter ? routeContext.getParameter(PippoConstants.REQUEST_PARAMETER_LANG).toString() : null; if (StringUtils.isNullOrEmpty(language)) { language = languages.getLanguageOrDefault(routeContext); } Locale locale = languages.getLocaleOrDefault(language); routeContext.setLocal(PippoConstants.REQUEST_PARAMETER_LANG, language); routeContext.setLocal(PippoConstants.REQUEST_PARAMETER_LOCALE, locale); if (setCookie) { if (routeContext.getResponse().isCommitted()) { log.debug("LANG cookie NOT set, Response already committed!"); } else { languages.setLanguageCookie(language, routeContext); } } routeContext.next(); }
processRouteInterceptors(routeContext); int postInterceptStatus = routeContext.getResponse().getStatus(); if (routeContext.getResponse().isCommitted()) { log.debug("Response committed by interceptor"); routeContext.next(); if (routeContext.getResponse().isCommitted()) { log.debug("Response committed in {}", LangUtils.toString(controllerMethod)); } else {
@Override public void handle(Context context) { String language = enableQueryParameter ? context.getParameter(Parameter.LANG).toString() : null; if (Strings.isNullOrEmpty(language)) { language = languages.getLanguageOrDefault(context); } Locale locale = languages.getLocaleOrDefault(language); context.setLocal(Parameter.LANG, language); context.setLocal(Parameter.LOCALE, locale); context.setLocal(Parameter.LANGUAGES, languages.getRegisteredLanguages()); if (setCookie) { if (context.getResponse().isCommitted()) { log.debug("LANG cookie NOT set, Response already committed!"); } else { languages.setLanguageCookie(language, context); } } context.next(); }
@Override public void handle(Context context) { String language = enableQueryParameter ? context.getParameter(Parameter.LANG).toString() : null; if (Strings.isNullOrEmpty(language)) { language = languages.getLanguageOrDefault(context); } Locale locale = languages.getLocaleOrDefault(language); context.setLocal(Parameter.LANG, language); context.setLocal(Parameter.LOCALE, locale); context.setLocal(Parameter.LANGUAGES, languages.getRegisteredLanguages()); if (setCookie) { if (context.getResponse().isCommitted()) { log.debug("LANG cookie NOT set, Response already committed!"); } else { languages.setLanguageCookie(language, context); } } context.next(); }
processRouteInterceptors(routeContext); int postInterceptStatus = routeContext.getResponse().getStatus(); if (routeContext.getResponse().isCommitted()) { log.debug("Response committed by interceptor"); routeContext.next(); if (routeContext.getResponse().isCommitted()) { log.debug("Response committed in {}", LangUtils.toString(controllerMethod)); } else {
processRouteInterceptors(context); int postInterceptStatus = context.getResponse().getStatus(); if (context.getResponse().isCommitted()) { log.debug("Response committed by RouteInterceptor"); context.next(); if (context.getResponse().isCommitted()) { log.debug("Response committed in {}", Util.toString(method)); } else {
processRouteInterceptors(context); int postInterceptStatus = context.getResponse().getStatus(); if (context.getResponse().isCommitted()) { log.debug("Response committed by RouteInterceptor"); context.next(); if (context.getResponse().isCommitted()) { log.debug("Response committed in {}", Util.toString(method)); } else {