public static String constructRedirectUrl(final String casServerLoginUrl, final String serviceParameterName,
                                              final String serviceUrl, final boolean renew, final boolean gateway, final String method) {
        return casServerLoginUrl + (casServerLoginUrl.contains("?") ? "&" : "?") + serviceParameterName + "="
            + CommonHelper.urlEncode(serviceUrl) + (renew ? "&renew=true" : "") + (gateway ? "&gateway=true" : "")
            + (method != null ? "&method=" + method : "");
    }
<p>constructRedirectUrl.</p>

@param casServerLoginUrl a {@link String} object
@param serviceParameterName a {@link String} object
@param serviceUrl a {@link String} object
@param renew a boolean
@param gateway a boolean
@param method a {@link String} object
@return a {@link String} object
pac4j-cas/src/main/java/org/pac4j/cas/redirect/CasRedirectionActionBuilder.java