#What #is #the #flow #of #execution #from #request #arrival #to #response #generation (#Explain #with #example #java #web #application)? #Adv #Java #Servlet #programming #Tutorial #advance #java #tutorial
Step 1,2
Step 3: Browser Window
http://localhost:2017/1DateApp/test1
C:\Tomcat 9.0 //step 4
|--webapps
|-----1DateApp //step 5
|-----WEB-INF
|-----web.xml
|-----classes //Step 10, 11
|------DateServ.java
|------DateServ.class
service(-,-){
--- //Step 12
}
With respect to the diagram and code:
Step 1) Programmer deploy's 1DateApp web application in tomcat server.
Step 2) Servlet container reads and verifies the web.xml file entries.
Step 3) End user types the request url in browser address bar.
Step 4) Based on "localhost:2017" of url the request goes to the Tomcat server of the current machine.
Step 5) Based on 1DateApp word of request url the request goes to deployed 1DateApp web application.
Step 6) 7) 8) 9) Based on the test1 word of request url the servlet container get the requested servlet program class name DateServ from web.xml file contents. (In this process is also uses logical name or servlet-name)
Step 10) Servlet container creates one set of requset, response object for current request.
Step 11) Servlet container locates our servlet class object DateServ. If created the initialization formalities will be completed.
Step 12) Servlet container calls service(-,-) on our servlet class object having request, response objects as arguments.
Step 13) The service(-,-) generates output, comes to browser window as an web page.