Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Arraylist of Custom Java Object in JSTL  RSS feed

Arun Shanmugam
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Java Entity named MyEntity which has getter and settter methods for id and name fields. I create 5 instances of MyEntity with different id's and Name's and store all of them in an arraylist. Finally I place the arraylist in the session Object.

I have the following on my jsp page
<%@ taglib prefix="c" uri=""%>
<%@ taglib prefix="html" uri=""%>
<jsp:useBean id="myEntity" scope="session" type="com.test.entity.MyEntity"/>

<c:set var="myList" value="${sessionScope.}"/> //I don't know what should go here as the object is not in the session, but the arraylist with objects is available.

<c:forEach var="testList" items="${myList}" varStatus="status">
alert(<cut value="${testList.}"/>) //Not sure what goes here as I don't know what I have in myList yet.

Could you help me.

Thanks a lot

I Got it on my own.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!