aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes how does tomcat 'know' what goes to the container and what doesn't ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "how does tomcat Watch "how does tomcat New topic
Author

how does tomcat 'know' what goes to the container and what doesn't ?

Mark Uppeteer
Ranch Hand

Joined: Mar 02, 2004
Posts: 159

Hi all,

I have a question about the container and the webserver...

When a request comes in, how does tomcat 'know' it's for the web container ?
how does it decide to that it should send it to the web container ? if I have a servlet with url-pattern the same as an available html page,
how does it decide what to do ?

Can tomcat have multiple webcontainers ? and of course then comes the question: how does it know what to send to what ?

I'm a bit confused on this (but havn't finished the book yet ,perhaps they'll talk about it later?)

Could anyone explain this please ?

thanks!


I know where my towel is. (SCJP 5, OCPJWCD)
[Free Quiz Tips for a fun night with friends or family] Flash games
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

You need to clear first what a servlet container and web server is. Look at this FAQ...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Mark Uppeteer
Ranch Hand

Joined: Mar 02, 2004
Posts: 159

Hi Ankit Garg,

thanks for your reply.

I think I know the difference between the web container and a webserver.
What did I say that didn't make sence to you ?

How I understand it:
The web server accepts the connection, "looks" if it is just a simple static get and it can serve it.
If not it forwards it (over socket) to the web container who handles it and sends back the reply.
This brings me back to my question, how does it know if it is for the container or not, and say it has a CGI container also,
how does it know where the request has to go ?
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

I don't know your answer, but I know that this kind of question was not in my test! =P

Try to post you question in another Java Forums Topic here in JavaRanch.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how does tomcat 'know' what goes to the container and what doesn't ?