IT Community - Software Programming, Web Development and Technical Support

lifecycle methods os JSP

This is a discussion on lifecycle methods os JSP within the Java Server Pages (JSP) forums, part of the Web Development category; can anyone tell me What are the life-cycle methods of JSP?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Java Server Pages (JSP)

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-24-2007, 06:50 AM
lavanya lavanya is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 24
lavanya is on a distinguished road
Question lifecycle methods os JSP

can anyone tell me What are the life-cycle methods of JSP?
__________________
Thanks,

Lavanya.J
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-02-2007, 12:10 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 350
Venkat is on a distinguished road
Thumbs up Re: lifecycle methods os JSP

hi,
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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-09-2007, 06:42 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: lifecycle methods os JSP

JSP Lifecycle:

Translation Phase: JSP Page will be converted to Servlet.

Compilation Phase: The resulting servlet is compiled.

Instantiate and loading Phase: Instance will be created for the servlet ands it will be loaded to memory.

Call jspinit():Perform Initialization process.

Call _jspService(): this will be called upon each request.

Call jspDestroy(): the instance will be destroyed when not needed any more.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different record methods Shanthi Testing Tools 1 08-27-2007 05:50 AM
Web service methods? devarajan.v XML and SOAP 1 08-11-2007 01:33 AM
When should I use constructors, and when should I use other methods? prasath Java Programming 1 07-20-2007 07:42 AM
What is a Windows Service and how does its lifecycle differ from a “standard” EXE? vadivelanvaidyanathan ASP and ASP.NET Programming 1 07-16-2007 01:31 AM
“magic” Methods ragavraj PHP Programming 0 03-17-2007 05:54 AM


All times are GMT -7. The time now is 11:28 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0