• 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

General Query about Servlet

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new learner of Servlets and JSP.
I have one query.

If a client request comes in for static content say html page, then does web server application like apache directly fetches the static content without handing request to web container like tomcat?
Because till now what I learned is that if a request is for servlet then the request is handed over to container(tomcat)
Let me know if I am correct or wrong.

Thanks in advance.
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess your understanding is correct, In case Tomcat doesn't run in standalone mode. The web server will process HTML files that are stored in the file system and Servlet requests are passed to the Web container.
 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hany
To be very honest, I didn't get your explaination for my query.
Can you please re-elaborate?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to understand that Tomcat is both a web server and a servlet container. The web server part is perfectly capable of serving static content like HTML and images. (This is what Hany calles "standalone mode".) Sometimes that part is handled by a dedicated web server (like Apache httpd), though, in which case Tomcat is used only for its servlet container functionality.
 
Hany Shafik
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure, but I think there are different modes in which you can run Tomcat.
You can run it in stand alone mode in such case the Servlet container is also a web server and handles both requests HTML pages and Servlet requests.
You can also run tomcat as a add-on to an existing web server (e.g. Apache), in this case only if the request is a Servlet request, the Servlet container will take control.
 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more question to this.

As per the discussion above, static content request are handled by web server application like apache, but how does it(apache) map the URL to the actual static resource, because mapping URL to resource is done by the container. So is it that web server application also has the same capability to map URL's to resource as container does?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic