dev@jersey.java.net

RE: [Jersey] JAX-RS based WebDAV support

From: Markus KARG <markus.karg_at_gmx.net>
Date: Wed, 10 Dec 2008 19:51:07 +0100

 

Paul,

 

I do not see that 400 would be a correct return code, since 400 means "The
request could not be understood by the server DUE TO MALFORMED SYNTAX.". The
syntax was not malformed, it was pretty correct! So still I believe that
nobody out there would say something against a single solution of injecting
null. Maybe we should let people vote? ;-)

 

Regards

Markus

 

 

 

For the issue with the empty bodies: We need to find a solution since it's
really a black spot on the overall great API. I think it would be not much a
problem to convince everybody that it makes more sense to inject null
instead of throwing a NullPointerException? :-)

 

Yes, i can see it both ways. Sometimes you want a null value to be
propagated and sometimes you do not and want a 400 response instead (the
latter probably being the most common i suspect).

 

One solution is to have a separate resource method for a request that does
not contain a request entity. Another could be to annotation the request
entity or the resource method that declares if there is not content-type
then the entity should be assigned a null value. I think i prefer the latter
solution.

 

Paul.