what is the difference between web server and web container

73 views
Skip to first unread message

Anas

unread,
Feb 7, 2009, 12:12:00 AM2/7/09
to Java EE (J2EE) Programming with Passion!
hello there
what is the difference between web server and web container ?
is the web container part of web server ?
is servlet web container or web component ?
thanks

Pravin Sinha

unread,
Feb 7, 2009, 9:44:20 AM2/7/09
to Java EE (J2EE) Programming with Passion!, anas.ahme...@gmail.com
Hi Anas,

As per my understanding it goes like this:
                                                    
Web Server : It accepts HTTP request from client(usually a web browser) and forwards it to web container. Gets the response from Web Container and forwards it back to client.
Web Container: It accepts request to from server and as per the request type call the service method(doGet, doPost etc) on the respective resource(servlet/JSP) based on uri and sends back the response to web server. It is also responsible for:
Communication support(socket creation), Servlet life cycle management (Init(), Service() and Destroy()), Multithreading support, Declarative security(thru deployment descriptor) and  JSP support .

is the web container part of web server ?
I know about Apache Tomcat. Earlier 'Apache' used to come as a separate web server.
 but now both come together as Apache Tomcat where Tomcat is an implementation of
the Java Servlet and JavaServer Pages technologies.


is servlet web container or web component ?
None. Servlet is niether. It is just a Java class capable of processing http based
request/response.


Thanks,
-Pravin
--- On Fri, 6/2/09, Anas <anas.ahme...@gmail.com> wrote:

Get perfect Email ID for your Resume. Get before others grab.

Anas

unread,
Feb 8, 2009, 7:09:37 AM2/8/09
to Java EE (J2EE) Programming with Passion!
thnks
useful information

On Feb 7, 6:44 am, Pravin Sinha <pks_chen...@yahoo.com> wrote:
> Hi Anas,
>
> As per my understanding it goes like this:
>                                                     
> Web Server : It accepts HTTP request from client(usually a web browser) and forwards it to web container. Gets the response from Web Container and forwards it back to client.
> Web Container: It accepts request to from server and as per the request type call the service method(doGet, doPost etc) on the respective resource(servlet/JSP) based on uri and sends back the response to web server. It is also responsible for: Communication support(socket creation), Servlet life cycle management (Init(), Service() and Destroy()), Multithreading support,
> Declarative security(thru deployment descriptor) and  JSP support .
>
> is the web container part of web server ?
> I know about Apache Tomcat. Earlier 'Apache' used to come as a separate web server.
>  but now both come together as Apache Tomcat where Tomcat is an implementation of
> the Java Servlet and JavaServer Pages technologies.
>
> is servlet web container or web component ?
> None. Servlet is niether. It is just a Java class capable of processing http based
> request/response.
>
> Thanks,
> -Pravin
> --- On Fri, 6/2/09, Anas <anas.ahmed.elsal...@gmail.com> wrote:
> From: Anas <anas.ahmed.elsal...@gmail.com>
> Subject: [java ee programming] what is the difference between web server and web container
> To: "Java EE (J2EE) Programming with Passion!" <java-ee-j2ee-progr...@googlegroups.com>
> Date: Friday, 6 February, 2009, 10:12 PM
>
> hello there
> what is the difference between web server and web container ?
> is the web container part of web server ?
> is servlet web container or web component ?
> thanks
>
>       Get perfect Email ID for your Resume. Grab nowhttp://in.promos.yahoo.com/address

dinesh

unread,
Feb 8, 2009, 11:18:04 AM2/8/09
to Java EE (J2EE) Programming with Passion!
A Web Server is a server capable of receiving HTTP requests,
interpreting them, processing the corresponding HTTP Responses and
sending them to the appropriate clients (Web Browsers). Example:
Apache Web Server.

A Web Container is a J2EE compliant implementation which provides an
environment for the Servlets and JSPs to run. Putting it differently
we can say that a Web Container is combination of a Servlet Engine and
a JSP Engine. If an HTTP Request refers to a Web Component (typically
a Servlet or a JSP) then the request is forwarded to the Web Container
and the result of the request is sent back to Web Server, which uses
that result to prepare the HTTP Response for the particular HTTP
Request. Example: Tomcat is a typical Web Container. A typical setup
would be to have Apache HTTP Server as the Web Server and Tomcat as
the Web Container.

An Application Server is a complete server, which provides an
environment for running the business components (EJBs, ADF BCs, etc.)
in addition to providing the capabilities of a Web Container as well
as of a Web Server. Example: Bea WebLogic, IBM WebSphere,
OracleApplication Server, etc

Nachiket Patel

unread,
Feb 8, 2009, 11:09:01 PM2/8/09
to java-ee-j2ee-progr...@googlegroups.com
Hello All,
I think web container is term used by java developers.. right??

Cheers,
Nachiket
--
Regards,
Nachiket Patel

Suhrid Karthik

unread,
Feb 8, 2009, 10:11:15 PM2/8/09
to dinesh....@gmail.com, Java EE (J2EE) Programming with Passion!
Nice explanation !
I have one question, assume that there is no "web container", how difficult (or easy) would it be to do server-side processing with just a plain old HTTP server ? i.e. what are all the things that the developer must manually do on his own ?

Thanks,
Suhrid.

On Sun, Feb 8, 2009 at 9:48 PM, dinesh <dinesh....@gmail.com> wrote:

Pravin Sinha

unread,
Feb 9, 2009, 12:19:53 AM2/9/09
to java-ee-j2ee-progr...@googlegroups.com, patel.na...@gmail.com
Nachiket,

Both are different. Web Container is nothing but an implementation of servlet/jsp technology. And a web server is the one which actually deals directly with client for HTTP request/response.

Pravin

--- On Sun, 8/2/09, Nachiket Patel <patel.na...@gmail.com> wrote:


Get perfect Email ID for your Resume. Get before others grab.

Rahul Kumar

unread,
Feb 9, 2009, 1:09:04 AM2/9/09
to pks_c...@yahoo.com, java-ee-j2ee-progr...@googlegroups.com, patel.na...@gmail.com
In Java Platform, Enterprise Edition, a web container "implements the
web component contract of the J2EE architecture".[1] This contract
specifies a runtime environment for web components that includes
security, concurrency, life-cycle management, transaction, deployment,
and other services. A web container provides the same services as a
JSP container as well as a federated view of the Java EE (formerly
J2EE) platform APIs.

Examples of web containers are:

Sun Java System Application Server
Sun Java System Web Server
Tomcat for Java WSDP

and



The term web server can mean one of two things:

A computer program that is responsible for accepting HTTP requests
from clients (user agents such as web browsers), and serving them HTTP
responses along with optional data contents, which usually are web
pages such as HTML documents and linked objects (images, etc.).
A computer that runs a computer program as described above
rahul

Nachiket Patel

unread,
Feb 9, 2009, 2:04:42 AM2/9/09
to java-ee-j2ee-progr...@googlegroups.com
Hello Shahnaz,
Try to google .Net Web Container or Microsoft Web Container...
You will get 0 results matching.. Because web container term is used by Java only.

Correct Definition: LINK -> http://www.geekinterview.com/question_details/64460

Glassfish server also works as Web server, and also contains Web container.
Now if you want to change web container and use some other web container (like Jetty) you can do that.
So by replacing web container.

Information from IT Toolbox (Link: http://java.ittoolbox.com/groups/technical-functional/javaee-l/difference-between-web-container-and-web-server-1903402 )
"A Web application runs within a Web container of a Web server. The Web container provides the runtime environment through components that provide naming context and life cycle management. Some Web servers may also provide additional services such as security and concurrency control. A Web server may work with an EJB server to provide some of those services. A Web server, however, does not need to be located on the same machine as an EJB server..
Web applications are composed of web components and other data such as HTML pages. Web components can be servlets, JSP pages created with the JavaServer Pages™ technology, web filters, and web event listeners. These components typically execute in a web server and may respond to HTTP requests from web clients. Servlets, JSP pages, and filters may be used to generate HTML pages that are an application’s user interface. They may also be used to generate XML or other format data that is consumed by other application components."

Cheers,
Nachiket



On Mon, Feb 9, 2009 at 10:40 AM, Shahnaz Khan <shahna...@gmail.com> wrote:

Hi Nachiket,
No web container is the very generic term. any system that contains all components(style sheets, media, scripts, classes, etc) related with any web application is called as web container. it can be a single software like apache tomcat or it can be group of various component. Like for example when we use PHP as a server side language and apache HTTP server as web container, than your web container contains PHP compiler.
--
Regards,
Nachiket Patel

MrWolf

unread,
Feb 9, 2009, 6:31:10 AM2/9/09
to Java EE (J2EE) Programming with Passion!

MrWolf

unread,
Feb 9, 2009, 6:17:45 AM2/9/09
to Java EE (J2EE) Programming with Passion!
Think you'll find this useful:

http://java.dzone.com/articles/tomcat-is-application-server-0

Cheers,

Fabian

On Feb 7, 6:12 am, Anas <anas.ahmed.elsal...@gmail.com> wrote:

Matias Blanch

unread,
Feb 9, 2009, 6:50:22 AM2/9/09
to java-ee-j2ee-progr...@googlegroups.com
Please unsuscribe me from the google group that I couldn't do it from
the web. I still want to remain in the course but with another mail
account that is already suscribed.

pooja srivastava

unread,
Feb 9, 2009, 6:52:37 AM2/9/09
to fabian....@gmail.com, Java EE (J2EE) Programming with Passion!
hello i hv some query in java..
please send me answers...

1)What is inner structure of byte code,means .class file mein kya hota hai jo jvm ko samajh aata hai??
 
2)what is ++C vs C++??
 
3)difference between data variable and objects??
 
4)data variable and object are same or not?
 
5) why data variables(classname variable name) calles as objects inC++ and in java these are not calles as objects??
Reply all
Reply to author
Forward
0 new messages