use of org.webpieces.router.impl.UrlInfo in project webpieces by deanhiller.
the class ProxyStreamHandle method createRedirect.
private XFuture<Void> createRedirect(HttpPort requestedPort, RouteId id, Map<String, Object> args, boolean isAjaxRedirect) {
if (methodMeta == null) {
throw new IllegalStateException("Somehow methodMeta is missing. This method should only be called from filters and controllers");
}
RequestContext ctx = methodMeta.getCtx();
RouterRequest request = ctx.getRequest();
Method method = methodMeta.getLoadedController().getControllerMethod();
UrlInfo urlInfo = reverseRoutes.routeToUrl(id, method, args, ctx, requestedPort);
boolean isSecure = urlInfo.isSecure();
int port = urlInfo.getPort();
String path = urlInfo.getPath();
RedirectResponse redirectResponse = new RedirectResponse(isAjaxRedirect, isSecure, request.domain, port, path);
return sendRedirect(redirectResponse);
}
Aggregations