Creating liferay portlet - how to pass data to view.jsp from Java class?

后端 未结 3 486
遥遥无期
遥遥无期 2020-12-24 02:46

I\'m trying to create portlet in liferay with just only from a JSP file called view.jsp. What I need is:

  1. When the portlet loads, I want to call

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-24 03:39

    You can do this in several ways :

    1) You can use renderRequest.setAttribute("my-array", array);

    2) You can put your data into a session

    request.getPortletSession().setAttribute("my-array", array);

    In the second case don't forget to delete your element from the session when you don't need it any more.

提交回复
热议问题