I have a question: I have a java object that's a List<User>
and I want pass it to javascript for populate the source of a jQuery autocomplete.
From jsp I pass the object present in the session by this tag
<input type="hidden" id="all_users" value=" < s: property value="#session.allUsers" /> " />
Then in javascript
var allUsers = $('#all_users').val().replace('[','').replace(']','').split(',');
Now I don't know what's next step because I obtain value as bean.User@4a255c. How I can convert this object for manage it in javascript and obtain the values that contains?
List<User>
to a JSON array, then parse it using JavaScript's builtin JSON capabilities to make it an array.