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

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

Introduction

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

Prototype

String CURRENT_URL

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

Click Source Link

Usage

From source file:com.liferay.social.activity.test.util.BaseSocialActivityInterpreterTestCase.java

License:Open Source License

@Before
public void setUp() throws Exception {
    group = GroupTestUtil.addGroup();//from  w  w  w .  j  a  v  a2 s  . c om

    trashHelper = _serviceTracker.getService();

    HttpServletRequest request = new MockHttpServletRequest();

    request.setAttribute(WebKeys.COMPANY_ID, TestPropsValues.getCompanyId());
    request.setAttribute(WebKeys.CURRENT_URL, "http://localhost:80/web/guest/home");
    request.setAttribute(WebKeys.USER, TestPropsValues.getUser());

    ServicePreAction servicePreAction = new ServicePreAction();

    ThemeDisplay themeDisplay = servicePreAction.initThemeDisplay(request, new MockHttpServletResponse());

    request.setAttribute(WebKeys.THEME_DISPLAY, themeDisplay);

    serviceContext = ServiceContextFactory.getInstance(request);
}

From source file:com.liferay.taglib.util.IncludeTag.java

License:Open Source License

private void _doInclude(String page) throws JspException {
    try {/*from  www  .j ava  2s . co  m*/
        include(page);
    } catch (Exception e) {
        HttpServletRequest request = getServletRequest();

        String currentURL = (String) request.getAttribute(WebKeys.CURRENT_URL);

        _log.error("Current URL " + currentURL + " generates exception: " + e.getMessage());

        LogUtil.log(_log, e);

        if (e instanceof JspException) {
            throw (JspException) e;
        }
    }
}

From source file:com.liferay.trash.web.internal.display.context.TrashContainerModelDisplayContext.java

License:Open Source License

public PortletURL getContainerURL() {
    String currentURL = (String) _request.getAttribute(WebKeys.CURRENT_URL);

    PortletURL containerURL = _liferayPortletResponse.createRenderURL();

    containerURL.setParameter("mvcPath", "/view_container_model.jsp");
    containerURL.setParameter("redirect", getRedirect());
    containerURL.setParameter("backURL", currentURL);
    containerURL.setParameter("classNameId", String.valueOf(getClassNameId()));
    containerURL.setParameter("classPK", String.valueOf(getClassPK()));

    return containerURL;
}