what is the difference between webserver and application server

I want to know the clear difference between webserver and application server. let say take tomcat and jboss. tomcat is web server and jboss is application server. i know that tomcat will just forward teh request and get teh response where as jboss will do transaction management also.

How it will do transaction management for an application. i want to know with a clear example
Who is Participating?
Scenario 1

Client request ------HTTP------->| Web server ----->JSP---->DB|  ----->HTTP response from web server to  client
Here the entire processing for getting the response to be sent happens on web server that can service HTTP requests.

Scenario 2

Client request ------HTTP------->| Web server (Java business class)|-------Look up service and then method call on obtained EJB ----RMI calls---->|Application server(EJB) ------> DB| -------------->method return value sent to web server  calling class ----->HTTP response from web server to client

Here the application server is a separate entity that is used to look-up business services and get return value after executing the methods on the (say EJB) objects obtained from app server. The web server only takes care of calling the method and preparing the response.
Please note: Apache Tomcat is an Application server now a Web server.

A basic "Apache HTTPD" install can be classed as a dedicated Web server, but include too many modules and you end up with what could be described as a basic application server.
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

CIPL-SenthilAuthor Commented:
i read the tutorial from javaworld. could you please explain clearly with an example how scenario 2 in javaworld tutorial  will work.
There isn't exactly an ANSI-defined, official definition of a "web" server or "application" server.   So there will never be a "clear" differentiation.  Plus web servers can be application servers  and application servers can run web services.

So best to ask your real question in context of what you have ... specifically what are you trying to know that made you want to know a specific definition for either of these fuzz terms?
Melih SARICAOwnerCommented:
if u look at the basic of those 2 words they are the same..

Applications that serve some data, kind of data is not important, called as applications server.. but normally it has its own data schema and  process request with that schema

a web server is an application server that serves HTML codes, images, xml and etc that are spesific for HTTP protocol..

thats it..
Typically a web server offers only web container that can service HTTP requests; while an application server offers support for other services like (EJBs, JNDI, JMS etc in J2EE stack) in a separate container in addition to the web container.
CIPL-SenthilAuthor Commented:
I was asked to refer to javaworld. actually javaworld will give a very good explanation of java concepts. Can any expert can explain the scenario 2 in javaworld for the differentiation between webserver and application server
CIPL-SenthilAuthor Commented:
Thanks for your clear explanation
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.