|
From: Bill B. <bb...@re...> - 2008-10-09 16:32:10
|
To get around the problem, set your content-type in your Response.
I'll log a jira bug and set the content-type if there is not one sent in
the response.
Todd O Elsethagen wrote:
> Hi,
>
> I'm having a problem when using the Response class. The following code
> worked in 1.0-beta-5 version but no longer works after upgrading to
> 1.0-beta-8. The only change i made from the beta-5 version to beta-8
> version is changing the @ProduceMime to @Produces. The beta-5 version
> would create an xml representation of the Protocol class, which contains
> jaxb annotations. However, the beta-8 version no longer creates the xml
> representation, it just returns a simple string that looks something
> like this, "Protocol@1253dfb". What do i need to change to get this to
> work in the beta-8 version?
>
> Thanks,
> Todd
>
>
> @GET
> @Path("protocol/{id}")
> @Produces("application/xml")
> public Response getProtocol(@PathParam("id") Long id);
>
>
> public Response getProtocol(Long id) {
>
> Response response;
>
> Protocol entity = protocolDAO.findById(id);
>
> if (entity != null) {
> response = Response.ok(entity).build();
> }
> else {
> response = Response.serverError().build();
> }
>
> return response;
> }
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|