I'm trying to pass a array of Document objects from a method (let's say from a controller) to the JavaScript from which the method is called (in a view). For some reason, the method won't pass the array (it works only if the array is empty). I also tried to put all the array members into a new array, even a list and pass it to the view, but it won't work (Inspect Element -> Console = 500 (Internal Server Error)) (I'm trying to pass a array of Document objects