When receiving data, it is important to note that the data is in the form of a Java object, specifically a list.
If you intend to manipulate this data, it is recommended to send a JSON string representation of the list from the server instead of the Java object itself. This can be achieved by converting the list into a JSON string.
var data = <%=request.getAttribute("objectFromServer") %>;
for (key in data ) {
//Perform operations here as needed.
}
This method is one approach to handling the data, but another option is utilizing EL expressions if minimal manipulation of the list is required (as utilizing JSON makes the process simpler in my opinion).