File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes General Computing and the fly likes Difference between servers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Difference between servers?" Watch "Difference between servers?" New topic
Author

Difference between servers?

Siddharth Bhargava
Ranch Hand

Joined: Feb 23, 2007
Posts: 266
What's the difference between Web server, Application Sever and Container. Please could anyone explain me the concept with examples .... !!! Thanks in advance.
[ July 24, 2007: Message edited by: David O'Meara ]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
This is how I see the things , might not be a very formal definations.

Web server - For basic HTTP requests.For serving static content.

Web container - Implementation of servlets and Jsp.

Application server - Implementation of certain J2EE x.x version.And has to pass the testcases mentioned in CTS (Compatibility test suite) provided by sun for that particular J2EE specification.
[ July 24, 2007: Message edited by: Rahul Bhattacharjee ]

Rahul Bhattacharjee
LinkedIn - Blog
Siddharth Bhargava
Ranch Hand

Joined: Feb 23, 2007
Posts: 266
Still not very clear concept wise...... Please could you give me some examples of products which are Web server and Web container but not application server. ...... or which are all of the three........Thanks in advance....
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Siddharth Bhargavav:
Still not very clear concept wise...... Please could you give me some examples of products which are Web server and Web container but not application server. ...... or which are all of the three........Thanks in advance....


TOMCAT is web container (static pages + servlets + jsp) but not application server as it doesnot implement the complete J2EE specification.

Websphere application server (WAS) is application server.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Be careful to define these terms when you have a conversation because they don't mean the same thing everywhere you go.

In my shop, an "HTTP server" does static HTML, images, etc, period. Anything that runs Java is an "application server". An application server can run a Servlet Container, an EJB Container or others. I doubt "container" is very well defined either, but these two are frameworks that run your code and provide useful services to your code. It very much feels like your code is running "inside" the container.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4655
    
    5

Originally posted by Rahul Bhattacharjee:


TOMCAT is web container (static pages + servlets + jsp) but not application server as it doesnot implement the complete J2EE specification.



Examples can be dangerous. Especially on terms that are defined by marketing folks.

Tomcat is also a web server (delivers static pages), and can be faster than Apache for some things.

Caucho's Resin is at least a web container, and delivers static pages well, but can't do all the things Apache can do. Resin started out as a JSP/servlet engine, but has added more J2EE stuff, I think it is full now.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Originally posted by Siddharth Bhargavav:
What's the difference between Web server, Application Sever and Container. Please could anyone explain me the concept with examples .... !!! Thanks in advance.

[ July 24, 2007: Message edited by: David O'Meara ]


Server - A machine which serves the requests (from clients) with the requested resources.

In order to receive a request and respond to it, there should be a means to communicate. In computer terminology, we term it as a protocol which is an agreement between the two parties involved (client and server) that states the rules and regulations for the communication.

Web Server - as it indicates a machine which could serve the requests over web. That means, through the protocol for web (HTTP - Hyper Text Transfer Protocol) this machine will serve a request from clients.

A Web Server is limited to serve the static resources which are present inside it.

Application Server - its also a server where its NOT restricted with a single protocol like HTTP. Unlike web servers, it can service any requests from various protocols like FTP, SMTP as well.

In other terms, Application Server is a superset of WebServer.

Container - An application/software which could run inside a Web or Application Server to provide a dynamic content generation facility. This could be of anything for taking a decision at runtime.

The Containers vary based on its nature. Some are Web Containers which could serve for the web technologies (Servlets, JSPs) whereas some are EJB Containers to serve for the business components (EJBs).

The containers is more-or-less like a stand alone application but with a restriction is that it has to adhere certain standards defined by the Specification for the nature of it. Web Containers have some standards to be adhered for the technologies involved whereas it would be totally different for the EJB containers as the specification for EJBs differ.

How JRE for your Java Applications, Containers are for your specialized Java programs. These specialized Java Programs could be a Servlet, JSP Page or an EJB or a Web Service or a Portal. But without these containers, these programs will find no supporting environment to withstand and run.

The containers basically provide the implementation of lifecyle management, networking, multi-threading features etc to maintain the application based on the technologies it supports.

The Application Server is somehow superficial wherein it provides the environment for the container to fit in and run inside it. The containers are pluggable inside a server(Web or Application).

Does that help you?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This question gets asked a lot in our Apache / Tomcat forum.
I've just added a FAQ entry.
It needs polishing but it covers some of the history behind these terms and should clear things up, or, at least explain why this will never be clear.
http://faq.javaranch.com/java/WebVsApplicationServer


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between servers?