Geeky Cat
Geeky Cat

Reputation: 61

How to pass ArrayList set from java to jsp in Liferay 7

I can't find any good working simple examples of passing ArrayList set values from java to jsp and ArrayList set values from jsp file to java, vice versa.

I have looked in different sites and tried but it is not working. I noticed they are all from previous versions of Liferay in which the syntax are different or functions that can't be found in Liferay 7.0. I would like to know how it is correctly implemented for Liferay 7 version.

Upvotes: 0

Views: 356

Answers (1)

Eloytxo
Eloytxo

Reputation: 141

In your portlet java class, into your render method:

renderRequest.setAttribute("attributeName", yourList);

In your jsp:

<jsp:useBean id="attributeName" type="java.util.List<your.list.class.package>" scope="request"/>

Upvotes: 2

Related Questions