What is the pros and cons of using Servlet Containers (like Apache Tomcat
) in contrast with using NIO frameworks (such as Netty
and Grizzly
) for hosting a JAX-RS RESTful service?
I'm going to develop a RESTful application using Java. Java has JAX-RS API (JSR 331 and JSR 339) for building RESTful services. There is different implementation for it as you can see here. All of them implement JAX-RS API and so it should be easy (at least in theory) to switch between them. Jersey
is the reference implementation and I chose it for now.
For the client part I'm going to use angularJS
+bootstrap
(so just html/css/js and no jsp pages).
Just for the record I say that I use PostgreSQL
as my DB and EclipseLink
as my JPA (ORM).
Here I think I just miss one part and that's the server part (the host for JAX-RS service). AFAIK I can either use a Servlet Container (e.g. Apache tomcat
) or a customize server (using NIO framwroks such as Netty
and Grizzly
, or maybe NIO.2 which is part of JDK 7) for that purpose.
But I don't know which one should I use. I think a pros and cons between this two solution help me choose one.