Example usage for com.liferay.portal.struts AuthPublicPathRegistry register

List of usage examples for com.liferay.portal.struts AuthPublicPathRegistry register

Introduction

In this page you can find the example usage for com.liferay.portal.struts AuthPublicPathRegistry register.

Prototype

public static void register(String... paths) 

Source Link

Usage

From source file:com.liferay.httpservice.internal.servlet.BundleServletContext.java

License:Open Source License

public void registerResources(String alias, String name, HttpContext httpContext) throws NamespaceException {

    Map<String, String> initParameters = new Hashtable<String, String>();

    initParameters.put("alias", alias);

    if (name == null) {
        throw new IllegalArgumentException("Name is null");
    }/*from  w  w w  . j  a v  a2s  .c  o m*/

    if (name.endsWith(StringPool.SLASH) && !name.equals(StringPool.SLASH)) {
        throw new IllegalArgumentException("Invalid name " + name);
    }

    initParameters.put("name", name);

    Servlet resourceServlet = new ResourceServlet();

    try {
        registerServlet(name, alias, resourceServlet, initParameters, httpContext);

        AuthPublicPathRegistry.register(Portal.PATH_MODULE + StringPool.SLASH + _servletContextName + alias);
    } catch (ServletException se) {
        throw new IllegalArgumentException(se);
    }
}