aspose file tools*
The moose likes Tomcat and the fly likes how web server communicates container? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how web server communicates container?" Watch "how web server communicates container?" New topic
Author

how web server communicates container?

baba
Greenhorn

Joined: Aug 17, 2006
Posts: 3
How will web server contacts container's DD (xml file) when it gets a request from a user. becase the only contact point to browser is web server (Apache). I mean is there any configuration set in web server which tells to goto some directory under some path and pick up "web.xml" of container and read all the servlets mentioned there?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Apache is not a servlet container and has no concept of web.xml or any other Java concept.

Did you mean Tomcat?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

And yes, each server that implements the Servlet specification will have a means to configure the various contexts (web applications) each of which has their own deployment descriptor.
baba
Greenhorn

Joined: Aug 17, 2006
Posts: 3
Yes, I agreed your point. I meant Tomcat in last post. One more thing Boss.

As per documents which I read I understood when user requests a HTTP request, apache "http"(not web) server will check for static page(if asked for static) or asks servlet container (tomcat) for the requested servlet(if asked for servlet). Then container will check for the servlet in DD and see if there is a class loaded already. If yes , it creates a new thread and invokes service method, which calls "our servlet code's" (which we wrote) doGet or doPost method. If class is not loaded it calls init() of our servlet code and creates instance of new servlet ( from now onwards new threads will be created from next requests on wards).

Am I correct?. Plese correct me if I am wrong.As its base for servlets I shd know things clearly.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat can be run as a standalone server (this is rapidly becoming the preferred route) or it can be connected to an HTTP server like Apache HTTPD.

I'll move this to our Apache/Tomcat forum where questions about connectors are best asked.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how web server communicates container?