0

I am a newbie when it comes to using servlets

Question:- When a http request comes in, does it first hits the JSP page or the Web.xml file.

there are two explanations which come to my mind. not sure which one is right.

Explanation A:- the http request comes in. the http request checks index.jsp . which sends some sort of action to XYZ servlet. and that is when it checks the web.xml to map it to the correct servlet

Explanation B:- the http request comes in. http request checks web.xml. from web.xml the http request navigates to the correct servlet. the servlet does some processing and forwards the response to the JSP page which finally gets rendered.

Which explanation from the above two explanation is correct. If both explanation are wrong, can you please provide me with a correct explanation?

can you please suggest a good link about how a request propagates through the Servlet domain [or the path it takes inside Servlet domain and when and what files it uses]. most links online have hidden when Web.xml or others files get used. They just give a brief overview. Can some one give some in detail explanation how does a request navigate in the servlet domain

user2166888
  • 579
  • 1
  • 5
  • 13
  • I would say that B is more accurate to what happens in the application server. – Luiggi Mendoza Dec 09 '14 at 22:32
  • Basically B, but the server actually reads the web.xml when the application starts and keeps all the url routing stuff in memory. – developerwjk Dec 09 '14 at 22:42
  • can you please suggest a good link about how a request propagates through the Servlet domain. most links online have hidden when Web.xml get used. They just give a brief overview. Can some one give some in detail explanation how does a request navigate in the servlet domain – user2166888 Dec 09 '14 at 23:06
  • http://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-session-variables-and-multithreading – Ken de Guzman Dec 10 '14 at 01:29

0 Answers0