Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is RESTful JSF possible?

Tags:

rest

jsf

seam

I recently sat down to port a simple Rails app I have to JSF (using Seam) to get a feel for which I would be more productive in. The Rails app is RESTful, which I like. Upon starting into JSF, I was surprised to learn, perhaps incorrectly, that JSF only support POSTs, which makes it inherently non-RESTful.

I searched around a bit but cannot find a satisfactory answer. JSF/Seam appears to be very popular, but it doesn't make sense to me that it would forbid all HTTP methods but POST. Is it true that JSF inherently does not allow for a RESTful architecture, or am I wrong and RESTful JSF is possible (inherently or through a plug-in)?

like image 405
SingleShot Avatar asked Sep 15 '09 17:09

SingleShot


People also ask

Can we create REST API using Java?

An API sets the rules by which these applications talk to each other. The Representational State Transfer (REST) is an architectural style for designing distributed hypermedia systems. A REST API is an API that conforms to the constraints of REST architectural style. There are several ways to make a REST API in Java.

Who invented REST API?

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.


1 Answers

Here's a blog post that works through this question, though it doesn't reach any solid conclusions.

In my personal experience, JSF/Seam aren't actually very popular, due in large part to these sorts of issues. It seems to try very hard to abstract away from the underlying nature of the web, and then breaks things like GET. The fix (for whatever problem you're having) is always "coming in the next version" or "not really a problem if you have good tools." YMMV, but I'd probably look at a different stack.

I've heard good things about Restlet, and I see that Struts 2 has a REST plugin. With Spring 3, Spring MVC has added support for REST. I've worked with Grails, and it made doing RESTful things fairly straightforward. It has the added bonus that it should be very familiar to you, since you're experienced with Rails.

like image 175
Hank Gay Avatar answered Oct 26 '22 12:10

Hank Gay