class NavigationUtils {

    public String getRedirectToSameDomainUrl(HttpServletRequest request, String url) {
        return String.format("redirect:%s://%s:%s/%s",
                request.getScheme(),
                request.getServerName(),
                request.getServerPort(),
                url);
    }

    private  NavigationUtils();

}