1 00:00:01,120 --> 00:00:03,140 Welcome to this lecture now. 2 00:00:03,170 --> 00:00:08,860 We'll go to the second part of the Diago as we have covered these three parts. 3 00:00:09,130 --> 00:00:12,730 Let me recapitulate what we have done in these three parts. 4 00:00:13,090 --> 00:00:17,980 The claims, things like the request or the container, the container creates a request and response 5 00:00:17,980 --> 00:00:18,880 objects request. 6 00:00:18,880 --> 00:00:23,550 In response, objects embody the actual request and responses. 7 00:00:24,430 --> 00:00:29,460 These requests and responses are sent to the head office servlet, not to the actual servlet, but the 8 00:00:29,560 --> 00:00:30,340 head of the subject. 9 00:00:30,340 --> 00:00:35,160 Even if the request is sent, another third will be created and so on and so forth. 10 00:00:35,620 --> 00:00:36,280 So let us see. 11 00:00:36,310 --> 00:00:37,140 No one did. 12 00:00:37,150 --> 00:00:43,780 The second part of the diagram for the second part of the diagram, the fourth part that is part of 13 00:00:43,780 --> 00:00:49,420 this continuum diagram is that this request and response. 14 00:00:51,040 --> 00:00:59,230 Is attached to the Soulet and the container called the service method of the Sonic are the types of 15 00:00:59,380 --> 00:01:06,340 which extension which are which are playing Java Object Exchange contains the service method and the 16 00:01:06,340 --> 00:01:14,800 service method has has different context and configuration related related gaud, which it does. 17 00:01:14,920 --> 00:01:16,950 So we need to call the service method. 18 00:01:16,960 --> 00:01:19,240 So the container called the service method. 19 00:01:19,420 --> 00:01:23,710 This is the fourth step of the life cycle of assembly. 20 00:01:24,140 --> 00:01:26,650 Now the next step. 21 00:01:27,830 --> 00:01:29,440 You know, in the next step. 22 00:01:32,540 --> 00:01:36,160 The service calls the service method father calls douget. 23 00:01:36,460 --> 00:01:43,540 Now, you know that the request has request object embodies the entire detail of the request. 24 00:01:43,580 --> 00:01:48,820 So it also knows that the request is a type of request because it's a type of request. 25 00:01:48,830 --> 00:01:52,350 The service will guard boogied if it was a forced type of request. 26 00:01:52,370 --> 00:01:54,340 It would have called to post. 27 00:01:54,680 --> 00:01:58,220 So in this example, we are calling the do get method. 28 00:01:58,640 --> 00:02:03,350 You know, once the douget method is called, we do the processing, whatever processing we wanted to 29 00:02:03,350 --> 00:02:05,990 do in the in the douget method with the request. 30 00:02:06,740 --> 00:02:11,390 And then we send a response back in this case and demand file. 31 00:02:11,690 --> 00:02:18,150 This is the initiative on file and embodied in the body of response and send it back to the container. 32 00:02:19,100 --> 00:02:29,430 And lastly, the container then sends an HDTV response back to the client, to the browser, and it 33 00:02:29,720 --> 00:02:31,090 does the estimate pitch. 34 00:02:31,520 --> 00:02:35,600 What happens in the server is that this thread is destroyed. 35 00:02:36,470 --> 00:02:45,080 The servlet can wait for another request or it can be destroyed, and the request and response are certainly 36 00:02:45,080 --> 00:02:45,740 destroyed. 37 00:02:46,880 --> 00:02:52,820 So these these things happen that is destroyed means they're dislocated for being sent for garbage collection 38 00:02:52,820 --> 00:02:53,480 in Java. 39 00:02:53,930 --> 00:02:57,230 OK, so this is what happens in the life cycle of a soulet. 40 00:02:57,230 --> 00:03:04,230 And I want to show you in a diagram form, we will also go to the life cycle of possibility in a in 41 00:03:04,240 --> 00:03:06,650 a exampled program, a Java program. 42 00:03:06,660 --> 00:03:11,060 B will create a servlet and we will see what happens. 43 00:03:11,060 --> 00:03:13,370 In what order does it happen? 44 00:03:13,610 --> 00:03:16,850 Destroy happen service happen to get dubost. 45 00:03:16,850 --> 00:03:18,230 In what order do they happen? 46 00:03:18,450 --> 00:03:20,270 When does the object get created. 47 00:03:20,420 --> 00:03:27,020 All these things we to see and then we actually called, then we actually program a sublet and we do 48 00:03:27,020 --> 00:03:29,330 that most probably in the next section.