Sebastian Luna
Sebastian Luna

Reputation: 496

JSP getting object from backend and manipulating in JS

I'm trying to get an array of objects in JSP, the problem is I need to manipulate the object I get later in JS, so I'm doing:

<c:forEach items="${ids}" var="idsP">
    <script>
        var object = ${idsP};
        console.log(object);      
    </script>
</c:forEach>

The problem with this code is that I get the reference to the instance of the object, so I'm getting in the console output:

co.com.processonline.entities.documentManagement.DocumentalTypeInstance@5dedbbe

If I try to get each attribute individually it works fine, but I need to get all the attributes in the object, Is there a way I can do that?

Thanks

Upvotes: 0

Views: 438

Answers (1)

Gnk
Gnk

Reputation: 720

You need to parse to json before print in your JSP

Upvotes: 1

Related Questions