Welcome my face.
Welcome to this lecture.
In this lecture, we will learn about Soviet life-cycle and its steps.
So let us get started with the step by step.
The first step is that the subject gets loaded, the loading of the subject when the wind of solar.
In our case, it is that what you don't get starts starts up.
Then the solar container deploys in the woods, all the subjects.
So during start up, the subject is deployed and it is loaded.
This is not true for all cases.
You have to specifically mention this, that you need it to be deployed and loaded at startup, explode
and load on startup and then don't need to happen otherwise.
When the first request is made to distill it, then it gets deployed and loaded.
OK, now in step two, we create the instance of the subject at this stage, it is only an object.
An instance of a Soviet means that, as we know in Java, it is an object.
And this object, it becomes an object based on a class, based on a template of a class and based on
the constructor.
So in this case, a no argument, no argument constructor is called and this object is created.
It is not a solid yet.
It is just a plain old Java object.
Now, the third step is we invoke init method.
Now, there are a couple of things that we need to understand.
First of all, it is after this init method, it becomes a subject.
Where is this method?
Who defines this method?
So what makes a solnik?
Possibly the servlet becomes a servlet because our subject is extending a class and that class is a
piece of class.
This class is an abstract class.
Now we know that in an abstract class, that may or may not be an implementation of different methods.
But when we extend it, we have to give implementation if it for instance.
So we have to give an implementation of these methods.
Such a method is the init method you can give.
You can override the method.
You can see that super in it, which means that whatever is in the bed in class, which is the servlet
class that should be done, it should be done that because all the configuration and context and everything
is handled by the should be subject class and it contains the implementation of a unique method.
You can also make something in your init justice and we will check that up when we write the code.
Now, next comes the step forward, which is invoking the service method.
The service method is invoked by the container.
The container invokes the init method and then comes back.
The control comes back to the container and the container now calls the service method.
It calls this service method whenever a request is asked and the request, if it does get request,
then the service method for the calls Huguet method.
If the request is Borst, then the service method further calls to post method.
The service method is defined in again, the Soviet method.
Right.
And B we override the budget and brute force method in other Soulet and we see what functionality we
want to provide.
What do we want to do?
We want to handle the request and then send the response, processing it and then send the response
so we can do a lot of things.
So that's the first and the Fifth Circuit invoking the disagreement before the object is destroyed.
Before the before the object is just destroyed as a solid.
It has destroyed the destroy method discard just before that.
So if you wanted to clean up your act before destroying the subject, you can use that destroy method.
So these are the basic steps of servlet lifecycle.
Now, there may be some confusion.
There may be some doubt.
I'll go to this to a diagram also in the next lecture.
Right.
And after that, I'll go to the program.
We will go to the sample program and we'll understand these steps further.
So don't worry about it.
OK, see you in the next lecture.