Hi, I have a web application and users can send each other messages i now want a page where i can display all messages of the user.

I found out that using a JSTL loop is probably the best option but when i use it it keeps just returning the last value in the list of messages. my code is as follows:

Java Code:
  <jsp:useBean id="messagebean" class="model.MessageList" scope="session" >
</jsp:useBean>
${messages.messageDetails.from}
<c:forEach var="messages" begin="0" end="${messages.numberOfMessages}" step="1">
  From ${messages.messageDetails.from}<br>
</c:forEach>
messages is my attribute set with request.setAttribute("messages", msg)
where msg is an arrayList of type MessageList i created with a method to add all messages of the user into one list

please help Thankyou :)