
|
If you were logged in you would be able to see more operations.
|
|
|
Resteasy
Created: 07/Apr/08 02:32 PM
Updated: 07/Apr/08 02:58 PM
|
|
| Component/s: |
jaxrs
|
| Affects Version/s: |
Beta1
|
| Fix Version/s: |
Beta2
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
|
Hello,
A couple of days ago I ran into a problem with throwing WebApplication examples with a response object:
throw new WebApplicationException(Response.status(412)
.type("text/plain;charset=utf-8")
.entity("Something went wrong").build());
Throwing this exception would give a text/plain body with the entity body but with http code 200. Throwing the same exception without an entity would give the expected (412 response with an empty body).
After a little code browsing I found the problem in Dispatcher.java invoke method. I created a patch file from revision 133 attached to this email.
Regards,
Thomas Cremers
Index: Dispatcher.java
===================================================================
--- Dispatcher.java (revision 135)
+++ Dispatcher.java (working copy)
@@ -136,6 +136,7 @@
if (jaxrsResponse.getEntity() != null)
{
+ response.setStatus(jaxrsResponse.getStatus());
MediaType responseContentType = resolveContentType(invoker, in, jaxrsResponse);
writeResponse(response, invoker, jaxrsResponse.getEntity(), responseContentType);
}
|
|
Description
|
Hello,
A couple of days ago I ran into a problem with throwing WebApplication examples with a response object:
throw new WebApplicationException(Response.status(412)
.type("text/plain;charset=utf-8")
.entity("Something went wrong").build());
Throwing this exception would give a text/plain body with the entity body but with http code 200. Throwing the same exception without an entity would give the expected (412 response with an empty body).
After a little code browsing I found the problem in Dispatcher.java invoke method. I created a patch file from revision 133 attached to this email.
Regards,
Thomas Cremers
Index: Dispatcher.java
===================================================================
--- Dispatcher.java (revision 135)
+++ Dispatcher.java (working copy)
@@ -136,6 +136,7 @@
if (jaxrsResponse.getEntity() != null)
{
+ response.setStatus(jaxrsResponse.getStatus());
MediaType responseContentType = resolveContentType(invoker, in, jaxrsResponse);
writeResponse(response, invoker, jaxrsResponse.getEntity(), responseContentType);
}
|
Show » |
|
There are no comments yet on this issue.
|
| |
|
|