Difference between an application server and a servlet container?
Asked Answered
C

5

132

I am trying to understand the difference between a full fledged application server (e.g. Weblogic, JBoss etc.) and a servlet container (Tomcat, Jetty etc.).

How do they differ and when to use which?

Thanks,

Clerihew answered 18/2, 2011 at 9:2 Comment(7)
#936697Life
@Jigar: if you know the precise question this duplicates, then you should actually vote to close it as a duplicate.Hundley
@Joachim I didn't vote to close.Life
because it isn't a duplicate. :)Dumbhead
oops ... feel free to ignore me, it seems I haven't gotten to my necessary caffeine level yet.Hundley
@Jigar - The question is different from what you have pointed out. I am asking about application server and not web server.Clerihew
@Apache read BalusC's answer there.Life
D
190

A servlet-container supports only the servlet API (including JSP, JSTL).

An application server supports the whole JavaEE - EJB, JMS, CDI, JTA, the servlet API (including JSP, JSTL), etc.

It is possible to run most of the JavaEE technologies on a servlet-container, but you have to install a standalone implementation of the particular technology.

Dumbhead answered 18/2, 2011 at 9:5 Comment(4)
+1 from my side,Good differences.Any more differences @DumbheadBlanka
@Bozho: +1: One thing I have so far noticed about you is the simplistic terms which you often embed in your amazing answers.Moratorium
it's very useful @DumbheadBloodstock
@Dumbhead Can servlet-containers be called out as servers with capabilities subset of *application server". And deep down they work identically(for the use cases common to both).Henryk
J
16

Broadly speaking, a servlet container restricts itself more or less to the implementation of the J2EE Servlet specification. Also, it's focus is on the runtime environment and not so much on providing additional tools.

In contrast, a full fledged application server implements the whole J2EE stack; plus it comes with all the enterprisey tools and integration possibilities. An application server usually has advanced administration interfaces, it supports clustering and other features used mostly in high-end systems development.

For a beginner, it's probably better to stay with a simple servlet container, since the learning curve there is much less steep.


Edit

@Apache Fan: It depends on the specifics of your situation like existing systems and future plans among other things. I don't think a generic flowchart approach is applicable here.

Platform selection is usually done by weighing specific requirements against first-hand knowledge of systems under consideration.

However the question gives no clues as to what the evaluation criteria are. Should it be open source? Is around-the-clock vendor support necessary? What kind of an enterprise environment should the system integrate with? Are licencing fees an issue? Any must-have technologies or tools? Etc.

Without knowing the above it's pretty much shooting in the dark.

Jolt answered 18/2, 2011 at 9:8 Comment(1)
I am asking from an enterprise perspective.Clerihew
R
12

Basically an application server in Java EE context is a software installed on a server and that implements one Java EE specification (Java EE 7 for example). That means such software (application server) must be able to run Java EE application.

Java EE defines 4 domains, the so called containers:

  • Applet container,
  • Application client container,
  • Web container, and
  • EJB container.

Two containers are part of the application server (EJB and Web container) and two others are part of the client-computer.

JBoss and Weblogic are application servers, Tomcat and Jetty are web container. That's why JBoss and Weblogic can deal with more technologies than a Web container. Application server can manage EJB.

Servlet container is not the appropriate expression to qualified Tomcat and Jetty because it is more restrictive. Tomcat can also execute JSP and JSF, not only Servlets.

Rowley answered 21/6, 2016 at 16:12 Comment(0)
P
3

In Layman terms : A web Server means: Handling HTTP requests (usually from browsers).

A Servlet Container (e.g. Tomcat) means: It can handle servlets & JSP.

An Application Server (e.g. GlassFish) means: *It can manage Java EE applications (usually both servlet/JSP and EJBs).

For a beginner, it's probably better to stay with a simple servlet container.

Protomorphic answered 8/2, 2018 at 10:29 Comment(1)
what are servlets?Pelagianism
P
2

afaik, websphere and jboss are fully compliant j2ee-server that can run beyond servlets, like EJB, whereas Tomcat is just a servlet container and you can't run EJBs on it.

Plead answered 18/2, 2011 at 9:6 Comment(2)
then under which category Apache server comes ?Conscientious
Apache HTTP Server is a full blown Web Server.Plead

© 2022 - 2024 — McMap. All rights reserved.