public String getProcessedUrlWithHdivState(final StringBuilder sb, final String hdivParameter, final String stateParam) { if (stateParam == null || stateParam.length() <= 0) { getParamProcessedUrl(sb); return sb.toString(); } getParamProcessedUrl(sb); char separator = containsParams() ? '&' : '?'; sb.append(separator).append(hdivParameter).append('=').append(stateParam); if (uriTemplate != null) { sb.append(uriTemplate.replace('?', '&')); } if (anchor != null) { // it could be "" sb.append('#').append(anchor); } return sb.toString(); }
public boolean isHdivStateNecessary(final HDIVConfig config) { if (isJS() || !internal || config.isStartPage(urlWithoutContextPath, method) || hasExtensionToExclude(config)) { return false; } boolean validateParamLessUrls = config.isValidationInUrlsWithoutParamsActivated(); // if url is a link (or a GET method form) and has not got parameters, we do not have to include HDIV's state if (isGetMethod() && !validateParamLessUrls && !containsParams()) { return false; } urlObfuscation = config.isUrlObfuscation(); return true; }