This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Arraylist of Custom Java Object in JSTL  RSS feed

 
Arun Shanmugam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html-el"%>
<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.
</c:forEach>


Could you help me.

Thanks a lot
Arun
-----------------------




I Got it on my own.

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