Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mark Uppeteer
Ranch Hand
Posts: 159
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to clear first what a servlet container and web server is. Look at this FAQ...
 
Mark Uppeteer
Ranch Hand
Posts: 159
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic