Search in sources :

Example 1 with RequestUtil.createSessionVersionString

use of org.apache.catalina.util.RequestUtil.createSessionVersionString in project Payara by payara.

the class Response method encodeURL.

/**
 * Encode the session identifier associated with this response
 * into the specified URL, if necessary.
 *
 * @param url URL to be encoded
 */
public String encodeURL(String url) {
    String absolute = toAbsolute(url);
    if (isEncodeable(absolute)) {
        // W3c spec clearly said
        if (url.equalsIgnoreCase("")) {
            url = absolute;
        } else if (url.equals(absolute) && !hasPath(url)) {
            url += '/';
        }
        String sessionVersion = null;
        Map<String, String> sessionVersions = request.getSessionVersionsRequestAttribute();
        if (sessionVersions != null) {
            sessionVersion = RequestUtil.createSessionVersionString(sessionVersions);
        }
        return toEncoded(url, request.getSessionInternal().getIdInternal(), sessionVersion);
    } else {
        return url;
    }
}
Also used : RequestUtil.createSessionVersionString(org.apache.catalina.util.RequestUtil.createSessionVersionString)

Aggregations

RequestUtil.createSessionVersionString (org.apache.catalina.util.RequestUtil.createSessionVersionString)1