RESTful Web Development With Java EE 6 - what are the options?

早过忘川 提交于 2019-12-03 15:03:32

I'd recommend you have a look at:

(One question though: why specifically do you need to be able to integrate with Java EE?)

EDIT: In the case where you absolutely want to use the Java EE APIs, then as mentioned by BalusC, JAX-RS is your solution of choice. Restlet and Jersey both support it. I don't know about RESTEasy, but the JAX-RS Wikipedia page mentions it does.

It's not JavaEE, just JavaSE (some may say that's a Good Thing) but the Play Framework is RESTful, and in my opinion is also very nice to use.

I've decided to go with Spring MVC. I didn't go for JSF 2 because it's just not very RESTful - it seems like a lot of work to get RESTful URLs (having to use plugins), it holds state server-side, and its not action oriented. Play seems like a very cool framework, but it isn't mature enough for me to justify using it yet (and I'm still not sure if you could use Java EE with it).

Spring MVC 3 allows you to map your URL's RESTfully and is action oriented - which I prefer.

I was looking into Grails which looks very promising but is still relatively new and it doesn't look like it has support for Java EE 6 yet.

I'll second @Haylem's recommendation of Restlet. We have a large project that leverages Java EE somewhat (some stateless session beans, Glassfish, a timer bean, servlets, JDBC, JNDI). Restlet fits in very well: you can run a set of web services inside a single Restlet-based servlet. You get an enormous amount of functionality for relatively little effort. We've been quite happy with it.

Since you have a Rails background, I'd recommend that you take a look at Scooter framework which ports lots of good stuff from Rails to Java. Like Struts and SpringMVC, it is an action based MVC framework. It handles restful routes beautifully. See the restful urls: http://scooterframework.com/docs/restful_routing.html

Its view layer technology is simply JSP, managed by SiteMesh layout framework. But it processes StringTemplate view files too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!