This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diff between Web & Servlet container

 
Sandeep Jindal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please tell me what is the difference between a servlet container and a web container.
What i think is, either both means same or, web container means a container for web modules, that may be just html pages and need not be jsp/sevlets/etc. And servlet container is the one that processes the full life cycle of a servlet.
In other words, web container is sub set of servlet container.
Please tell me if i am correct or correct me other wise

Thanks
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web or HTTP servers generally handle only static content - images and HTML pages and such. When they recognize dynamic content requests by extension or path or some other indicator they pass the request on to CGI, ASP, servlet, etc. So a servlet container is a "plugin" to an HTTP server. In my WebSphere project they are on separate boxes, but some other products may bind them together so neatly that you can barely see the seams.
 
Sandeep Jindal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stan,

Thanks for the clear explanation.

Can you please tell me some example server, where i have a web/http server(Both are same, rite??), and a pluggable servlet container. Do tomcat provide this feature?

Regards
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. but not very efficient with static web contents like images and etc.
 
Afroz Ahmed
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Web container only for request/response and gets all static pages
Servlet Container can do dynamic things and send dynamic reposes..

For clear clarification refer 'Head First Servlets and JSP' by Kathy Sierra.


Not a member of Head First Series Marketing Team.
[ October 11, 2004: Message edited by: Afroz Ahmed ]
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The concept of Web Servers came before the Concept of Application Servers.

ie earlier there were server programs available which was able to satisfy requests for static contents
like a text/image/any kind of file. These servers have a context within which the files which can be served
by this server are kept. and this context can be reffered as WEB CONTAINER.

later when the concept of Application Servers came, they were introduced as plugin components,
since there were lots of Standalone WebServers were already there.

Later, when there were webservers which came with the built-in support of application Servers. ie
now-a-days, when you buy a AppServer, it has a WebServer built along with it.

BEA WebLogicServer,iPlanet,WebShpere.. all these servers have both web & app servers together.These
can also be configured as just web-servers and use anyother server as servlet container. If done so, since
the request has to pass to two different servers,two different JVM's, it has its own overhead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic