Glassfish与Tomcat的RESTful服务 [英] Glassfish vs Tomcat for RESTful Services
问题描述
- 我们需要一些指导来选择合适的服务器,如Tomcat或Glassfish等。请分享理由。
- 另请指导我们的JAX-RS决策是否适合构建RESTful服务。
Tomcat只是一个servlet容器,仅仅意味着它不会提供对Java EE特性。
不仅仅是看RESTful服务,还要看你打算用什么来实现你的层功能。如果你只使用Servlet / JSP,那么Tomcat肯定是一个非常合理的选择。如果您需要使用JavaEE功能,请参阅GlassFish。
纯粹在功能方面,GlassFish可以完成Tomcat所能做的一切,还有更多,因为它是一个完全符合JavaEE的应用服务器。但是,请注意,Tomcat对许多复杂的应用程序(不使用Java EE功能)的效果很好。
在性能方面,Tomcat是轻量级的,启动速度非常快,并且在Eclipse环境中得到很好的支持。 GlassFish的启动速度稍慢(我的可怕笔记本电脑大约需要11秒),但部署速度非常快。
Tomcat有一个用于基本应用程序部署的管理器应用程序,但是JNDI和类似的资源配置(如用户配置)必须通过手动编辑XML文件来完成。 Glassfish有一个很好的管理控制台,允许你从中央用户界面执行所有这些操作,而无需手动配置编辑。
无论如何,我得到的是您的选择应该完全基于您打算从Java / Java EE API中使用的内容以及最低限度符合该法案的服务器。不要以任何流行的共识为依据,因为您的要求是您最好的指导。
就使用JAX-RS而言,我没有看到任何顾虑那里。我已经和泽西合作过,并且在这里看一看这两者:
http://www.slideshare.net/pelegri/jersey-and-jaxrs-presentation
最后,就SSL而言:两者Tomcat和Glassfish将乐于做SSL,无论在任何方面都没有问题。
GlassFish SSL tut: http://javadude.wordpress.com/2010/04/06/getting-started-with-glassfish-v3 -and-ssl /
祝您好运。
I have a .net development background but relatively new to Java world. We have started development of RESTful services (public web APIs) with JAX-RS to be consumed mostly by mobile platforms (Android, iPhone, windows phone etc.)
- We need some guidance on selection of appropriate server such as Tomcat or Glassfish etc.? Please share reason as well.
- Also please guide whether our decision of JAX-RS is appropriate for build RESTful services.
Tomcat is a servlet container only, which simply means that it will not provide support for Java EE features.
More than looking at RESTful services, see what you intend to use to implement your tier functionality. If you are sticking with Servlet/JSP only, then Tomcat would definitely be a very reasonable choice. If you need to use JavaEE features, then look at GlassFish.
Purely in terms of functionality, GlassFish can do everything Tomcat can, and a lot more, because it is a fully JavaEE compliant application server. But, take note, that Tomcat is used to great effect for a lot of complex applications (that don't use Java EE features).
In terms of performance, Tomcat is lightweight, starts really fast, and is well supported in the Eclipse environment. GlassFish startup is a bit slower (around 11 seconds on my horrible laptop), but deploys are blazing fast.
Tomcat has a manager application for basic app deployment, but JNDI and similar resource configurations (like user configs) have to be done by editing XML files manually. Glassfish has a nice administration console which allows you to do all this from a central UI without manual configuration editing.
Anyways, what I'm getting at is that your choice should be based solely on what you intend to use from the Java/Java EE APIs, and the server that minimally fits that bill. Don't go by any popularity consensus, as your requirements are your best guide.
As far as implementing with JAX-RS is concerned, I don't see any concerns there. I've worked with Jersey, and here's a sneak peek looking at the two: http://www.slideshare.net/pelegri/jersey-and-jaxrs-presentation
Lastly, as far as SSL is concerned: Both Tomcat and Glassfish will happily do SSL, no issues in either whatsoever.
GlassFish SSL tut: http://javadude.wordpress.com/2010/04/06/getting-started-with-glassfish-v3-and-ssl/
Good luck.
这篇关于Glassfish与Tomcat的RESTful服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!