Hi JAX-RS interested people,
for my master thesis I will refer to JAX-RS 0.8, which is the public
review draft (see https://jsr311.dev.java.net). I will hand out the
thesis by the 10th of July the latest. Before this date I think I have
no time to update to another JAX-RS version. And between the first
Restlet 1.1 Release Candidate and the final 1.1 release I think it is
not useful to change something here.
Jerome, if you want to rename the projects in the repository from *_0.9
to *_0.8 (* = org.restet.ext.jaxrs and javax.ws.rs), please ask me
before, if I have uncommited changes.
As additional feature to the official API, you could use
org.restlet.data.Representation and its subclasses as entity without the
need of an entity provider for this. You could return every
Representation subclass as entity. If you want to get a Representation
subclass as entity into a resource method, this class must have a
constructor with:
* a Representation as the one and only argument
* a Representation and a class as only arguments, where the class is
the generic type of the Representation subclass, e.g. the
JibxRepresentation
There are some small things that are not (yet) supported by the JAX-RS
extension:
* The change of headers and the throwing of WebAppicationExceptions
in a message body writer could not work (IMO :-) ), because the
Restlet Engine first sends all headers and than start to write the
message body. Here the MessageBodyWriter is started, when the
headers and the empty line is already send. So headers could not
be changed (because also send) or add (because new line is already
send). The same is valid for the WebApplicationException with its
status.
* @PathParam PathSegment do not work yet. There are some discussions
in the expert group now, so I could not finish the full
requirements for the matching. As workaround you could use
@Context PathParam, to get the latest matched path segment.
o This will work in a later version of this extension
o All other things defined with @PathParam in the spec should
work now.
* @Path(limited=false) is not fully restricted: Now also
@Path(value="ab{CDE}fg", limited=false) is also matched, if CDE
matches multiple path segments.
o This will also work in a later version of the extension.
* Because the setting of cache options is not supported by the
Restlet API until now, it is also not supported in this extension
for now.
o This will also work in a later version of the extension.
* Authentication is only supported, if a Guard is used. The user
name detected by the Servlet container (or other connectors) is
not available yet; the same is valid for the role check. The
reason is, that there is some refactoring planned in the JAX-RS
authentication. I think, after that refactoring, this is also
available
o If you need the role check, you could implement the
interface RoleChecker and add its instance to the
JaxRsApplication.
* the de/encoding is only nearly full supported.
I hope I forgot nothing.
If you have used this extension already, something is missing or you
otherwise have comments, let me know. If told me bugs or something else
before the release, we could include fixes ...
best regards
Stephan