如何将哈希集添加到java

时间:2015-09-09 04:18:14

标签: java web-services jaxb jax-rs

我正在尝试将一个hashset嵌入到javax.ws.rs.core.Response的实体中

例如:

@GET
@Path("someting...")
@Produces("application/xml")
public Response getStuff( ... ...) {
    Set<customisedClass> stuff = retrieveMethod(xx);
    return Response.ok().entity(stuff).build()

这会给我:

Could not find MessageBodyWriter for response object of type: java.util.HashSet of media type: application/xml

有谁知道我应该怎么做? “customisedClass”已经正确注释。

由于

0 个答案:

没有答案