protected void redirectToPage(RoutingContext context, Map<String, String> params, Throwable... exceptions) { try { if (exceptions != null && exceptions.length > 0) { logger.debug("Error user actions : " + params.get("error"), exceptions[0]); } String uri = UriBuilderRequest.resolveProxyRequest(context.request(), context.request().path(), params); doRedirect(context.response(), uri); } catch (Exception ex) { logger.error("An error occurs while redirecting to {}", context.request().absoluteURI(), ex); context.fail(503); } }
protected void redirectToPage(RoutingContext context, Map<String, String> params, Throwable... exceptions) { try { if (exceptions != null && exceptions.length > 0) { logger.debug("Error user actions : " + params.get("error"), exceptions[0]); } String uri = UriBuilderRequest.resolveProxyRequest(context.request(), context.request().path(), params); doRedirect(context.response(), uri); } catch (Exception ex) { logger.error("An error occurs while redirecting to {}", context.request().absoluteURI(), ex); context.fail(503); } }
/** * Wrap the todo entity with appropriate id and URL. * * @param todo a todo entity * @param context RoutingContext * @return the wrapped todo entity */ private Todo wrapObject(Todo todo, RoutingContext context) { int id = todo.getId(); if (id > Todo.getIncId()) { Todo.setIncIdWith(id); } else if (id == 0) todo.setIncId(); todo.setUrl(context.request().absoluteURI() + "/" + todo.getId()); return todo; } }