File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes java and restlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "java and restlet" Watch "java and restlet" New topic

java and restlet

bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
does Java really need Restlet to communicate with REST?

is it worth learning and using it?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Need? No. For accessing resources over HTTP, you can use any other HTTP API, like the HttpURLConnection class, or the HttpClient library. I would imagine that the Restlet client API has some nice utility methods that make it easier, though.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
The other toolkit to look at is the open source Jersey project. This is the demo implementation of the JAX-RS (JSR-311) API and I suspect it is more likely to make it into standard Java than Restlet.

Peer Reynders

Joined: Aug 19, 2005
Posts: 2933
Restlet, Jersey, and JSR-311 (JAX-RS) are server-side frameworks for building RESTful web services. A (test) client emerged with Jersey - though more or less accidentally, that is not in response to JSR-311 (see com.sun.jersey.client.apache for an HttpClient backed version). Personally, I think that HttpClient is probably the best foundation for a client of a RESTful web service - especially as there don't seem to be any tools that consume WADLs to produce client-side proxies.

That being said Restlet does offer a org.restlet.Client class. This is mainly motivated by the desire to hide the standard java client/server class asymmetry (e.g. client-side HttpUrlConnection vs. server-side HttpServletRequest/HttpServletResponse) and replace it with a symmetry where both client and server use and

To understand the relationship between Restlet and JSR-311 see Restlet API and JSR-311 API.
I agree. Here's the link:
subject: java and restlet
It's not a secret anymore!