File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Kathy\Bert please reply(Container and Server) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Kathy\Bert please reply(Container and Server)" Watch "Kathy\Bert please reply(Container and Server)" New topic

Kathy\Bert please reply(Container and Server)

Mitesh Khapra

Joined: Oct 25, 2004
Posts: 6
I had posted this twice earlier but did not get any reply so am posting it again. Kathy\Bert please help!!!
I was reading the second chapter of "HF-Serlets and JSP" and came across the terms "container" and "server". Till now my understanding was that a server itself controls the life cycle of a servlet. But here it is mentioned that the life cycle is controlled by a container. Can somebody please clear the following doubts related to container and server:-

1. Do they run in the same JVM or different JVM
2. Can somebody please tell me what is a "container" and what is a "server" in the context of IBM's Websphere.

Thanks and Regards,
louise rochford
Ranch Hand

Joined: Apr 04, 2002
Posts: 119
Hi Mitesh,

The terms Container and Server tend to be used interchangably.
'Server' can also be used to mean the machine that everything runs on.
I think officially one should use the term 'web app server' for the component that runs kind of like an underlying operating system, intercepting all requests to the machine. This web app server passes requests on to the continer when appropriate.
The container is the piece of software that sits within / alongside the web app server and has its own jvm. Since you're posting in the SCWCD forum, I guess you're most interested in the web container. If you're developing EJBs, these would run in an EJB container. You can also have multiple versions of each container running on a single server & each has its own jvm.

It used to be that if you were working in the open source arena, you could think of Apache as the web server, Tomcat as the web container & JBoss as the EJB container. Nowadays I think these components come bundled together in some ways and the distinction isn't so obvious.

In terms of Websphere (which I also use ) the distinction isn't obvious at all - the product has all of the above components "seamlessly integrated". It hasn't got in the way for me when writing / developing code etc, but is one of those things WebSphere does to 'help' that makes it much harder to understand how things work when you're trying to learn the technology. (I also hate the 'project' business...)
Might be worth posting a specific question on the Websphere forum for more info.

I agree. Here's the link:
subject: Kathy\Bert please reply(Container and Server)
It's not a secret anymore!