|
From: Todd O E. <tod...@pn...> - 2008-10-09 16:45:32
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That worked. Thanks!<br>
<br>
Bill Burke wrote:
<blockquote cite="mid:48E...@re..." type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator"
content="MS Exchange Server version 6.5.7653.38">
<title>Re: [Resteasy-developers] Having problems after upgrading to
beta-8 version</title>
<!-- Converted from text/plain format -->
<p><font size="2">To get around the problem, set your content-type in
your Response.<br>
<br>
I'll log a jira bug and set the content-type if there is not one sent in<br>
the response.<br>
<br>
Todd O Elsethagen wrote:<br>
> Hi,<br>
><br>
> I'm having a problem when using the Response class. The following
code<br>
> worked in 1.0-beta-5 version but no longer works after upgrading to<br>
> 1.0-beta-8. The only change i made from the beta-5 version to
beta-8<br>
> version is changing the @ProduceMime to @Produces. The beta-5
version<br>
> would create an xml representation of the Protocol class, which
contains<br>
> jaxb annotations. However, the beta-8 version no longer creates
the xml<br>
> representation, it just returns a simple string that looks
something<br>
> like this, "Protocol@1253dfb". What do i need to change to get
this to<br>
> work in the beta-8 version?<br>
><br>
> Thanks,<br>
> Todd<br>
><br>
><br>
> @GET<br>
> @Path("protocol/{id}")<br>
> @Produces("application/xml")<br>
> public Response getProtocol(@PathParam("id") Long id);<br>
><br>
><br>
> public Response getProtocol(Long id) {<br>
><br>
> Response response;<br>
><br>
> Protocol entity = protocolDAO.findById(id);<br>
> <br>
> if (entity != null) {<br>
> response = Response.ok(entity).build();<br>
> }<br>
> else {<br>
> response = Response.serverError().build(); <br>
> }<br>
><br>
> return response;<br>
> }<br>
><br>
><br>
><br>
>
-------------------------------------------------------------------------<br>
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge<br>
> Build the coolest Linux based applications with Moblin SDK &
win great prizes<br>
> Grand prize is a trip for two to an Open Source event anywhere in
the world<br>
> <a moz-do-not-send="true"
href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a><br>
> _______________________________________________<br>
> Resteasy-developers mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:Res...@li...">Res...@li...</a><br>
> <a moz-do-not-send="true"
href="https://lists.sourceforge.net/lists/listinfo/resteasy-developers">https://lists.sourceforge.net/lists/listinfo/resteasy-developers</a><br>
<br>
--<br>
Bill Burke<br>
JBoss, a division of Red Hat<br>
<a moz-do-not-send="true" href="http://bill.burkecentral.com">http://bill.burkecentral.com</a><br>
</font>
</p>
</blockquote>
<br>
</body>
</html>
|