The Sun BabelFish Blog
Don't panic !
Restlets, the next thing after servlets?
I have been looking for a client side API for implementing the Atom Publication Protocol (APP). Since APP is based on REST principles it would be nice for there to be a good Java library that worked at the right level of abstraction.
Dave Johnson has recently written a book where he uses the apache commons httpclient library to implement APP. The code is available on blogapps.dev.java.net, in the chapter10/atomclient directory.
Last week I came across the Restlet library that is designed to work both for client tools as well as for servers, and is designed to replace the Servlet interface. Could this be even better? It is certainly taking the paradigm seriously and so does warrant a close look.
Feedback welcome, and I'll post my experiences.
Posted at 11:07AM Mar 21, 2006 [permalink/trackback] by Henry Story in Java | Comments[9]
Note on comments:
- I know the forms below are a little small. We have asked for years for this to be changed, but I don't think it's going to happen soon. In Apple's Safari you can resize the entry box with you mouse. For people using other browsers click on this javascript link, that should allow you to resize your form.
- Comments are moderated, so they will take a little time to appear. Currently moderation means I have to read them personally. Hopefully with OpenId deployment, this will become more automated.
- HTML markup no longer works here, due to some decision made somewhere. Sorry about that.
- If you are having trouble posting, it may be that you need javascript to be enabled. I don't think javascript should be needed for submitting a form, but that's the way it is here.
- Check your comments by using the preview button...


Posted by Dave Johnson on March 21, 2006 at 02:34 PM CET #
In order to understand Restlets, you have first to be familiar with the concepts of REST. Have you read the chapter defining REST?
The Restlet API is mapping one-to-one each concept of REST into a Java interface. So in term on complexity it shouldn't be much more than the complexity of REST. And we are still in the beta phase, so please help us simplify the API even more. BTW, the Restlet API JAR itself is very light, about 65kb with no external dependency.
Concerning the Servlet API, you probably missed the fact that there is a connector allowing you to run your Restlets within a Servlet container. But if you don't need a Servlet container, I suggest to use the standalone HTTP connector powered by Jetty.
The NIO assumptions are based the analysis of an expert participating to the Servlet API specification process, Greg Wilkins, who is BTW the main developer of Jetty! Please read the Restlet introduction paper for further references.
Finally, did you run the tutorial examples? Didn't they make sense to you at all? If not, please feel free to seek support in our mailing list, we'll be glad to help you.
Best regards,
Jerome Louvel
Posted by Jerome Louvel on March 23, 2006 at 02:33 PM CET #
Posted by Dave Johnson on March 23, 2006 at 03:08 PM CET #
Posted by Henry Story on March 23, 2006 at 03:14 PM CET #
Posted by Dave Johnson on March 23, 2006 at 03:32 PM CET #
Posted by Jerome Louvel on March 23, 2006 at 03:42 PM CET #
I should be able to get to it the week after next. Next week I need to write a new version of the rdfhibernate library. Right now I am working on some wizards for Sun.
If someone in the meantime rewrote Dave Johnson's example atom client using restlets, that would probably help me along very much. It would also probably end up being very helpful to the atom protocol working group as that is sure to reveal some interesting problems.
Otherwise I'll have some good experience in a couple of weeks...
Posted by Henry Story on March 23, 2006 at 07:14 PM CET #
Posted by Jerome Louvel on March 23, 2006 at 08:44 PM CET #
Posted by Henry Story on March 23, 2006 at 10:02 PM CET #