• Welcome to NamesLot.com Domain Name Forum

    NamesLot.com Domain Name Forum offers a fully open forum to discuss domain industry news and a 0% commission marketplace for you to buy and sell domain names.

    We have reorganized our Marketplace so now it is easier to get attention to your domain while it is also easier for buyers to find the right domain name.

    If you want us to add more threads to our marketplace, please contact us! Listing on our marketplace as always, 100% free! Register NOW or Login HERE!

Explain the life-cycle mehtods in JSP?

Status
Not open for further replies.

rominekarte

New Member
The generated servlet class for a JSP page implements the HttpJspPage interface of the javax.servlet.jsp package. Hte HttpJspPage interface extends the JspPage interface which inturn extends the Servlet interface of the javax.servlet package. the generated servlet class thus implements all the methods of the these three interfaces. The JspPage interface declares only two mehtods - jspInit() and jspDestroy() that must be implemented by all JSP pages regardless of the client-server protocol. However the JSP specification has provided the HttpJspPage interfaec specifically for the JSp pages serving HTTP requests. This interface declares one method _jspService().
The jspInit()- The container calls the jspInit() to initialize te servlet instance.It is called before any other method, and is called only once for a servlet instance.
The _jspservice()- The container calls the _jspservice() for each request, passing it the request and the response objects.
The jspDestroy()- The container calls this when it decides take the instance out of service. It is the last method called n the servlet instance.
 
Well @ rominekarte!A JSP page services requests as a servlet. Thus, the life cycle and many of the capabilities of JSP pages (in particular the dynamic aspects) are determined by Java Servlet technology.
JSP page translation
JSP page compilation
load class
create instance
call the jspInit method
call the _jspService method
call the jspDestroy method
When a request is mapped to a JSP page, the web container first checks whether the JSP page’s servlet is older than the JSP page.
 
Thanks for providing such a wonderful and valuable information for life- cycle methods in JSP, as I was also pursuing knowledge of java and its life cycle but not about JSP page
 
jsp life cycle has three important methods such as

- ->this initalizes the jsp information with the configuration
parameters.

- service : We have to Put business logic here. that is all the request and
responses goes here.

- : once the process is completed it will be killed.
 
Status
Not open for further replies.

Members online

No members online now.

Forum statistics

Threads
19,801
Messages
69,798
Members
44,585
Latest member
tsscgroup
Active members today
0
New members today
0
New threads today
2
New posts today
2

Follow NamesLot on Twitter!

NamesLot proudly supported by

NamesLot proudly supported by

Top