Example usage for com.liferay.portal.kernel.util WebKeys SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID

List of usage examples for com.liferay.portal.kernel.util WebKeys SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util WebKeys SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID.

Prototype

String SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID

To view the source code for com.liferay.portal.kernel.util WebKeys SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID.

Click Source Link

Usage

From source file:com.liferay.frontend.js.spa.web.internal.servlet.taglib.util.SPAUtil.java

License:Open Source License

public boolean isClearScreensCache(HttpServletRequest request, HttpSession session) {

    boolean singlePageApplicationClearCache = GetterUtil
            .getBoolean(request.getAttribute(WebKeys.SINGLE_PAGE_APPLICATION_CLEAR_CACHE));

    if (singlePageApplicationClearCache) {
        return true;
    }//from   w w w. ja  v a 2  s  . c  o  m

    String portletId = request.getParameter("p_p_id");

    if (Validator.isNull(portletId)) {
        return false;
    }

    String singlePageApplicationLastPortletId = (String) session
            .getAttribute(WebKeys.SINGLE_PAGE_APPLICATION_LAST_PORTLET_ID);

    if (Validator.isNotNull(singlePageApplicationLastPortletId)
            && !Objects.equals(portletId, singlePageApplicationLastPortletId)) {

        return true;
    }

    return false;
}