I have a bean and want to iterate through the values and store it in an array.
My form bean name is keywords and the element to be accessed is keywordList, so in my JS when I alert(“${keywords.keywordList}”);
I get [com.test.bean.Keyword@10, com.test.bean.Keyword@f, com.test.bean.Keyword@e], but I want the values and assign them to a var, how can I do this?
Here is how I solved my problem
And since I was using logic:iterator and displaying the values in the table, I added
Now when I alert collection, all the words are in the array. Which is exactly what I need.