0
votes

We have a custom portlet having an MVCActionCommand invoked from another portlet. MVCActionCommand executed successfully but on the page it's showing empty portlet body in results page. Expected is jsp is having data to render based on response and we are having static html code like input text and tabs to filter data.

We are using below code in Controller to redirect to JSP

actionResponse.setRenderParameter("jspPage", "/META-INF/resources/results_page.jsp);

Main issue is, this we are facing only in PROD environment, UAT & local environment it's working fine Below is my portlet @component values.

@Component(
    immediate = true,
    property = {
        "com.liferay.portlet.display-category=category.search",
        "com.liferay.portlet.instanceable=false",
        "javax.portlet.init-param.template-path=/",
        "javax.portlet.init-param.view-template=/view.jsp",
        "javax.portlet.init-param.add-process-action-success-action=false",
        "javax.portlet.name=SearchResults",
        "javax.portlet.resource-bundle=content.Language",
        "com.liferay.portlet.add-default-resource=true",
        "javax.portlet.security-role-ref=power-user,user"
    },
    service = Portlet.class
)

Redirection to page is happening correctly but portlet body is empty. In this page I have some static HTML code in this page and its also not loading.

Why different environments have different behavior for same piece of code? Below is the screen shot.

empty portlet body

1

1 Answers

0
votes

I would recommend that you use the "mvcPath" parameter since "jspPath" is deprecated. Example usage: EditUserOrganizationsMVCActionCommand.java