RESTful Java Web Services Framework Suggestions ...

I was looking for some information about web services, it looks like an enterprise application. I found that RESTful design is a very cool idea. I think Apache CXF looks cool, it supports RESTful and Java design. Is it a good choice for beginners to start writing an application using Apache CXF? or any other framework?

+5
source share
6 answers

I recommend using JAX-RS because IMHO is the most neutral structure in terms of how you should do REST. I did not use CXF, only Jersey. This is a very reliable implementation and comes with a good client connector (the client side is not yet part of JAX-RS).

An unnecessary attitude towards “how to make REST” is important because the “best” way to approach certain aspects (for example, hypermedia design) has not yet been recognized.

Congratulations on your REST path - you won’t regret it.

Jan

+4
source

I would go for Jersey , RI JAX -RS (JSR 311), Java API for RESTful web services (i.e. standard).

+8
source

spring 3.0 REST. spring MVC 3.0 REST Apache CXF.

+2

Restlete - RESTful Java: http://www.restlet.org/

+1

REST RESTEasy 30 . lib JBoss.

+1

PlayFramework. , , - RESTFul:

# ====== Order service =========================
GET /orders Orders.list
GET /orders/{<[0-9]+>id} Orders.show
PUT /orders/{<[0-9]+>id} Order.saveUpdate
POST /orders Orders.saveNew
# ==============================================

:

public class Orders extends Controller {
   public static void list() {
      List<Order> orders = Order.all();
      render(orders);
   }
   public static void show(long id) {
      Order order = Order.findById(id);
      notFoundIfNull(order);
      render(order);
   }
   public static void saveUpdate(long id, Order update) {
      Order order = Order.findById(id);
      notFoundIfNull(order);
      order.update(update);
      show(id);
   }
   public static void saveNew(Order order) {
      order.save();
      show(order.getId());
   }
}

, -:

String url = "https://ajax.googleapis.com/ajax/services/search/web";
Map<String, Object> params = new HashMap<String, Object>();
params.put("v", "1.0");
params.put("q", searchStr);
params.put("key", Play.configuration.get("app.google.key"));
params.put("userip", myIpAddr);
HttpResponse resp = WS.url(url).params(params).get();
return resp.getString();
+1

All Articles