Hi,
I'm using POJOs and annotations with json. Using a arraylist in @Get (public
ArrayListT myGet()), jackson serialize that as
{name:DITest8,siteOwnerId:255,siteId:8,loca},{...} (using my
webbrowser)
On the clientside i therefore get the values in an arraylist with LinkedHashMap
instead
I was able to convert the LinkedHashMap values to ArrayListT using the
ObjectMapper in my clientcode:
ObjectMapper mapper =
jacksonConverter.getObjectMapper();
ArrayListSiteDAO sites = mapper.convertValue(tmp, new
TypeReferenceArrayListSiteDAO()
One problem is that the generic type formal parameter T doesn't convey
enough information for the annotation-based code to reconstruct the correct
result type. Try creating a type that embeds the actual value of the type
parameter, e.g., SiteDaoArrayList extends ArrayListSiteDAO (or
If, during conversion of a request body, my converter's (subclass of
ConverterHelper) toObject method identifies some problem with the structure or
content of the body, I'd like to be able to return detailed information back to
the client in the response body (e.g. missing field 'foo').
Hold on, it looks like there was an update to ConverterService about a year ago
that addressed this (by no longer squelching the exception). It's just not in
2.1, which is what I'm using. Any chance it might be backported to 2.1?
--
Hello,
I think that the following will also work:
@Get
public ArrayListSiteDAO myGet() {
...
}
Best regards,
Thierry Boileau
2014/1/7 Tim Peierls t...@peierls.net
One problem is that the generic type formal parameter T doesn't convey
enough information for the annotation-based code to
6 matches
Mail list logo