Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how web server communicates container?

 
baba
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64848
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache is not a servlet container and has no concept of web.xml or any other Java concept.

Did you mean Tomcat?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64848
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic