I need to provide data for google APIs table... so I\'ll send it from servlet to JSP
but how can I access this data in \"googles\" javascript?
I\'ll provide
since the ArrayList is having objects of Strings you can simply use split() method on the value of the array list. Something like as below;
function showTable() {
<%
Object obj = session.getAttribute("list");
List list = null;
if (obj != null) {
list = (ArrayList) obj;
} else list = new ArrayList(); %>
var jsList = <%=list.toString()%>
//remove [] from content
jsList = jsList.replace("[","");
jsList = jsList.replace("]","");
//split the contents
var splitContent = jsList.split(","); //an array of element
for(var i=0;i
}
I hope this will help you solve this.