-
Feb 13th, 2012, 08:11 PM
#1
Can I return a list of Objects from restTemplate.getForEntity
I know I Can do this:
ResponseEntity<MyObject> myObject = restTemplate.getForEntity(url, MyObject.class );
but can I easily return a List of Objects as well, like this:
ResponseEntity<List<MyObject>> myObjectList = restTemplate.getForEntity(url, ???.class );
I'm new to this, so I may be missing something easy here...
I read that there are messageConverters, but I was hoping I wouldn't have to right one...or maybe they aren't that bad to right. Any examples would be great.
-
Mar 24th, 2012, 08:36 AM
#2
Hi, your MyObject in
ResponseEntity<MyObject> myObject = restTemplate.getForEntity(url, MyObject.class );
can have a getList() method, is it good for you?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules