Difference between web server and application server

17,495

Solution 1

A web server is something that handles HTTP requests and responses.

An application server (like WebLogic, WebSphere, JBoss AS, Glassfish, etc) usually includes a web server, but also adds a lot more features. The most important is that it manages objects. Whether they will be servlets (Servlet container), EJBs (ejb container), JMS listeners, etc.

Solution 2

I would say definitions vary. In the generalized context, a Web Server is a server that can receive incoming web-requests and have knowledge about how they should be handled and responded to. Some requests are static (html files, images etc), some are dynamic. In the case of dynamic requests, the web server will know where to route handling of the request, could be a JSP page or a java servlet, a PHP script, a perl CGI script etc etc.

While the "web server" in this context executes the dynamic handler, it is not considered to include any supporting middleware features for the dynamic handler.

An Application Server, by contrast, is a general execution environment that offers some type of middleware tier support. Examples are EJB containers or the .NET framework built into Windows (in where Windows in itself is an "application server"). There is no inherent requirement that an application-server have anything to do with web requests (although many do), it's just a general execution context and container for any type of application that offers some sort of additional middleware support.

In a purely web-centric context, many people will draw the line at static vs dynamic content. In this definition, a "web server" can only handle requests for static information itself and it will pass on requests for dynamic content to the "application server". For example, Apache httpd is a web server and Tomcat is an application server. IIS is a combination of both. In the Java web world, an application server can be either a servlet container (like Tomcat), or a full blown Java EE container (like JBoss, WebLogic or WebSphere) that provides the Java EE middleware support (EJB) container in addition to the servlet container.

Solution 3

Webserver can execute only web applications i,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web applications

Application server can execute Enterprise application, i,e (servlets, jsps, and EJBs) it is having two containers 1. Web Container(for interpreting/executing servlets and jsps) 2. EJB container(for executing EJBs). it can perform operations like load balancing , transaction demarcation etc etc

Share:
17,495
copenndthagen
Author by

copenndthagen

Buy some cool JavaScript related merchandise from; https://teespring.com/stores/technical-guru-2

Updated on July 19, 2022

Comments

  • copenndthagen
    copenndthagen almost 2 years

    As a layman, how do I understand the difference between web server and application server ? If you could give an example using a Java based web app in very "simple" terms that would be really great..

    Also when we say Weblogic, is it a web server only ?

  • Zemzela
    Zemzela almost 13 years
    can't agree more, just to add some samples: JBoss, Weblogic, Websphere,Glassfish are app servers, Apache Tomcat is servlet container, and "Apache HTTP Server" is web server .
  • Bozho
    Bozho almost 13 years
    oddly enough, I listed exactly the same four app servers that you did, without seeing your comment :)