Example usage for com.liferay.portal.kernel.portlet ResourceServingConfigurationAction serveResource

List of usage examples for com.liferay.portal.kernel.portlet ResourceServingConfigurationAction serveResource

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.portlet ResourceServingConfigurationAction serveResource.

Prototype

public void serveResource(PortletConfig portletConfig, ResourceRequest resourceRequest,
            ResourceResponse resourceResponse) throws Exception;

Source Link

Usage

From source file:com.liferay.portlet.portletconfiguration.action.EditConfigurationAction.java

License:Open Source License

@Override
public void serveResource(ActionMapping actionMapping, ActionForm actionForm, PortletConfig portletConfig,
        ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception {

    Portlet portlet = null;/*w  ww. j  a v  a2  s .  c  om*/

    try {
        portlet = ActionUtil.getPortlet(resourceRequest);
    } catch (PrincipalException pe) {
        return;
    }

    resourceRequest = ActionUtil.getWrappedResourceRequest(resourceRequest, null);

    ResourceServingConfigurationAction resourceServingConfigurationAction = (ResourceServingConfigurationAction) getConfigurationAction(
            portlet);

    if (resourceServingConfigurationAction == null) {
        return;
    }

    resourceServingConfigurationAction.serveResource(portletConfig, resourceRequest, resourceResponse);
}