• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how web server communicates container?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic