All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.web.vhost.VirtualHostHelper Maven / Gradle / Ivy

The newest version!
package com.enonic.xp.web.vhost;

import javax.servlet.http.HttpServletRequest;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public final class VirtualHostHelper
{
    private static final String KEY = VirtualHost.class.getName();

    @Deprecated
    public static boolean hasVirtualHost( final HttpServletRequest req )
    {
        return getVirtualHost( req ) != null;
    }

    public static VirtualHost getVirtualHost( final HttpServletRequest req )
    {
        return (VirtualHost) req.getAttribute( KEY );
    }

    public static void setVirtualHost( final HttpServletRequest req, final VirtualHost vhost )
    {
        req.setAttribute( KEY, vhost );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy