It's not a secret anymore!*
The moose likes Servlets and the fly likes Container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Container" Watch "Container" New topic
Author

Container

Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
Can anyone please expalin me the difference between web server and container of servlet . Please i am getting onfused very much ..
Alos, i have heard that container is the thing in which servlet can view its environment variables, wht this means ???


Thanks<br />Dinesh
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30370
    
150

Dinesh,
A web server serves static content like HTML, CSS, JavaScript and image files. These are files that are the same each time they are requested. A web container within an application server can serve static content or dynamic content. Dynamic content files can and likely do change each time such as servlets and JSPs.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Firstly the subject line "Container" makes little sense, you need to make it more descriptive.

As Jeanne said, a web server is meant to serve static content, it just accepts request for a valid resource and serves it, if security constraints are met.
A container is something that "contains" or holds. Like a servlet container contains servlets and a EJB container contains EJBs. It provides an execution environment for the dynamic content it holds.

Lastly I dont think this question really belongs to the servlets forum.


SCJP, SCWCD.
|Asking Good Questions|
sameer khazi
Greenhorn

Joined: Sep 05, 2008
Posts: 28


Mr.Ghorpade. Thanks for the explanatory note. Actually we just move ahead without actually understand what certain words means as what you have said about the Web Server and Container.

Though we believe to be very much understood the meaning of so and so term but really i must appreciate that JavaRanch makes things so easy to learn.

Thank you All
aleem khan
Ranch Hand

Joined: Aug 07, 2008
Posts: 94
Hi all,
Are you guys sure about the concepts which you have told? Tomcat is a webserver but Jboss is Web application server...tomcat can generate dynamic content so it means webserver too can generate dynamic content? am i right??


SCJP(1.4), SCWCD, Oracle 9i SQL certified, Oracle PLSQL Developer Certified Associate
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
You need to understand that there are any number of definitions for these terms around. Unless we all agree exactly which definitions we use we have only commonly used terms, about which there may be disagreement what they mean.

What is generally agreed upon is that Tomcat is a web server and a servlet container. In the sense that it can serve Java web applications it is also an application server. JBoss, on the other hand, can also server JEE applications, which makes it a different kind of application server.

The term that seems to cause the most confusion is "web container", which is why I encourage people not to use it.

This page may also help clear up the confusion: WebVsApplicationServer
[ September 21, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Tomcat is a webserver but Jboss is Web application server...tomcat can generate dynamic content so it means webserver too can generate dynamic content?

Tomcat in itself is not a web server, its a container. When you say Apache Tomcat, then its a web server with a servlet and JSP container.
Whereas Jboss is a full fledged J2EE application server since it can cater EJBs also.
And as Ulf said, you need to read that FAQ entry to make things a bit clear.
But as the FAQ says, the distinction will always remain blurry.

Hope this helps
[ September 21, 2008: Message edited by: Amit Ghorpade ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Mr.Ghorpade. Thanks for the explanatory note

You are welcome
 
wood burning stoves
 
subject: Container