JSP’s life cycle can be grouped into following phases.
A java servlet file is generated from the JSP source file. This is the first step in its tedious multiple phase life cycle. In the translation phase, the container validates the syntactic correctness of the JSP pages and tag files. The container interprets the standard directives and actions, and the custom actions referencing tag libraries used in the page.
The generated java servlet file is compiled into a java servlet class.
Note: The translation of a JSP source page into its implementation class can happen at any time between initial deployment of the JSP page into the JSP container and the receipt and processing of a client request for the target JSP page.
The java servlet class that was compiled from the JSP source is loaded into the container.
In the execution phase the container manages one or more instances of this class in response to requests and other events.
The interface JspPage contains jspInit() and jspDestroy(). The JSP specification has provided a special interface HttpJspPage for JSP pages serving HTTP requests and this interface contains _jspService().
jspInit() method is called immediately after the instance was created. It is called only once during JSP life cycle.
This method is called for every request of this JSP during its life cycle. This is where it serves the purpose of creation. Oops! it has to pass through all the above steps to reach this phase. It passes the request and the response objects. _jspService() cannot be overridden.
This method is called when this JSP is destroyed. With this call the servlet serves its purpose and submits itself to heaven (garbage collection). This is the end of jsp life cycle.
jspInit(), _jspService() and jspDestroy() are called the life cycle methods of the JSP.
Comments are closed for "JSP Life Cycle – explain.".
figure for jsp life cycle is not given here..
Excellent man, you really helped me.
thank you.
Keep it UP.
one thing I would like to Suggest you,
that you can Show JSP life cycle Diagramatically.
its really nice ………
it s very useful for knowing abt jsp..
thank u
thanx
it really helped me a lot in understanding JSP and its life cycle. keep it up
Thanks for helping me..
Its clearly undersandale for beginners…..
Thanks for helping me..
Its clearly undersandable for beginners…..
thanks bro…..it’s really helpful
Great work
I understood the JSp lifecycle fully
Good
very very simple and nice site thanks admin
Its the best page i have ever visited about jsp life cycle.
best explanation for jsp life cycle in any java blog i have seen…..
thanks for the definition on jsp life cycle. it’very useful.
Jsp Lifecycle with a neat sketch:
Check out the other information for this topic in your book.
Lifecycle explaination is Excellent
simple and understandable………! nice work.
excellent.
thank you very much for definition – a neat sketch for jsp life cycle too is suggested.
the contents are clearly presented in this site.good work !
Good one
good example for the life cycle
very easy and nice example
Excellent post on jsp life cycle ! thanks a lot!
exellent explenetion
Good explanation.Figure needed to explain the jsp life cycle completely.
very good exellent explenetion
I have been consistently asked for a diagram to explain JSP life cycle. Quite soon I will update it. Thanks guys.
excellent
so brief but fair enough, thanx
Thanx for t clarity on life cycle phases. It was good explanation.
thank u so much for explaiing the jsp lifecycle ya,,,,,,,,,,,,,,,,,,,,,,,,,,
by
dinesh mca
ramanathapurm(district)
Perfect Job Thanks Man.
easy and compact to answer in interviews
can any body explain point no 7 above
7. jspDestroy() execution:
This method is called when this JSP is destroyed.
whaether this method is called to destroy jsp/when jsp is destroyed.
thnx in advance
EXCELENT info on life cycle
fantastic!!!mind blowin!!!
Thanks, t u r explanation about the jsp Life Cycle
In the WebContainer calls init() and destroy() methods call only once and Service() method calls zero or more than no. of times in SERVLET life cycle.
like in this way
jspInit() and _jspDestroy() methods call once or more than once?
jspService() method calls Zero or more than no. of time ?
that game was called paratrooper
Thanks Sp, I too figured it out lately.
thank….
though i did a project using jsp ,still ni d`t know this basic
yes it help me lot……..keep it up..
Really small but efficient material for jsp .
Thanks! It was helpful,.
It’s very fantastic ….thanks pa….I need brief about jsp..send to my mail quickly..
life cycle flow is marvelous..thanks v want more infor about jsp..if anybody knows plz send to my mail id…..
Really It’s very useful for me….I’m gng to do project in jsp so plzzz give more inf about jsp and help for my project…
waiting for answer……
please tell me
if jsp which was called first time has been destroyed by using jspdestoy()method.Suppose if the server gets same jsp request what would happen second time whether it needs to execute all the lifecycle methods or only jspService().if it execute jspService() how it will be available because jsp already destroyed .
Thanks in advance.
thank you very much.this one help more to me.but here not given the daigram.
Thanks t’s very fantastic
Good one Jeo…Neatly explained
The content is very useful, and clearly explained.
Raghuram
Very good explanation ::
Thanks buddy , hope it remains in my brain till interview :-)
thank! u for the info.
Good!
ok excellent
i am satisfied
Thanks buddy , hope it remains in my brain till interview :-)& I Hope you got lot of info:about jsp search now ok best of luck…………………………
RAJ YADAV
please tell me
if jsp which was called first time has been destroyed by using jspdestoy()method.Suppose if the server gets same jsp request what would happen second time whether it needs to execute all the lifecycle methods or only jspService().if it execute jspService() how it will be available because jsp already destroyed .
Thanks in advance.
Really fine work but now I have switched to .Net
Every jsp page make a related servlet and servlet gets executed
very good.nice attempt:)
thankx bro.. you helped me to pass exam..
Thanks and that was a gud one.