Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Denis Korablev
Asset
February 20, 2013 11:09 AM
Answer

Denis Korablev

Rank: New Member

Posts: 4

Join Date: April 26, 2012

Recent Posts

Hi everyone,

I defined MyAssetRenderFactory in liferay-portlet.xml

MyAssetRenderer.render function:

 1
 2    @Override
 3    public String render(RenderRequest renderRequest, RenderResponse renderResponse, String template) throws Exception {
 4        // TODO Auto-generated method stub
 5
 6        if (template.equals(TEMPLATE_FULL_CONTENT)
 7                || template.equals(TEMPLATE_ABSTRACT)) {
 8            return "/folderInMyPortlet/myTemplate.jsp";
 9        }
10        else {
11            return null;
12        }
13    }


This code cause NullPointerException in
ROOT/html/portlet/workflow_task/edit_workflow_task.jsp
1<liferay-util:include page="<%= path %>" portletId="<%= assetRendererFactory.getPortletId() %>" />


Because /folderInMyPortlet/myTemplate.jsp is not found i guess.

In all examples, that i saw, render function returns reference to JSP under ROOT/html/portlet/**. But my JSP template resides in my portlet. How do i return reference to my JSP template without coping it to ROOT/html/portlet/?

tnx-