Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ratna rathor
Jsp life cycle.
2 Answer(s)      2 years and 7 months ago
Posted in : JSP-Interview Questions


What is JSP life cycle?


Advertisement
View Answers

May 22, 2012 at 6:45 PM


Life cycle of JSP (Java Server Page),after translated it works like servlet.It contain 7 phases-

1.Page Translation ? The page is parsed and a java file containing the corresponding servlet is created.

2.Page Compilation ?The java file is compiled and java servlet class is created.

3.Load Class ?The compiled class is loaded.

4.Create Instance ? An instance of the servlet class is created.

5.Call jspInit()- This method is called before any other method to initialisation. This method is called only one time during JSP life cycle.

6.Call _jspServices()- This method is called for each request.

7.Call jspDestroy() ?his method is called when the servlet container decides to take the servlet out of service.



May 27, 2012 at 9:50 PM


JSPÔ??s life cycle can be grouped into following phases.

  1. JSP Page Translation:

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.

  1. JSP Page Compilation:

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.

  1. Class Loading:

The java servlet class that was compiled from the JSP source is loaded into the container.

  1. Execution phase:

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().

  1. Initialization:

jspInit() method is called immediately after the instance was created. It is called only once during JSP life cycle.

  1. _jspService() execution:

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.

  1. jspDestroy() execution:

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.

Please click here to get More about it



Related Tutorials/Questions & Answers:
Jsp life cycle.
Jsp life cycle.  What is JSP life cycle?   Life cycle of JSP (Java Server Page),after translated it works like servlet.It contain 7 phases.... This method is called only one time during JSP life cycle. 6.Call
Life Cycle of a Jsp Page
Life Cycle of a Jsp Page     ... as the servlet life cycle. After get translated the jsp file is just like a servlet. The life cycle of the jsp page is given below: jspInit(): This method
Advertisements
JSP Life Cycle
JSP Life Cycle In this section we will discuss about life cycle of JSP. Like the each Java based web technology JSP also follows a life cycle.... In the core of the JSP, Java Servlet technology is executed therefore, JSP life cycle
Coding for life cycle in threads
Coding for life cycle in threads  program for life cycle in threads
Servlet Life Cycle
Servlet Life Cycle  Servlet Life Cycle
servlet life cycle
servlet life cycle  What is the life cycle of a servlet
Flex Component Life Cycle
Flex Component Life Cycle  hi.... please tell me about What is Flex Component Life Cycle? Thanks  Ans: There are following pase of flex component life cycle. 1. Initialization phase 2. Update phase 3
Hibernate Life Cycle
This tutorial contains full description of Hibernate life cycle
JSP Page Architecture and its life cycle
and it's life cycle. In short, Java Server Pages(JSP) is a high level extension...' package that contains the life cycle methods of complied JSP Page. jspInit... response) are the life cycle methods of the compiled JSP page. Diagram of JSP
bean life cycle methods in spring?
bean life cycle methods in spring?  bean life cycle methods in spring
Life-Cycle of flex application
Life-Cycle of flex application  hi..... Please tell me What is LifeCycle of Flex-Application? please give me the answer ASAP. Thanks  LifeCycle of flex application: When we create a flex application in Adobe
Five disciplines in the Iterative Life Cycle
Five disciplines in the Iterative Life Cycle  hello, What are the Five disciplines in the Iterative Life Cycle?   hii, These are the Five Disciplines in the Iterative Life Cycle:- Requirements Analysis and Design
JSF Life Cycle
JSF Life Cycle In this section we will discuss about life cycle of JSF. This section will describe you JSF life cycle. Life cycle of JSF specifies... life cycle for every request and response. Request for the JSF page can
DbUnit test Life Cycle
DbUnit test Life Cycle       DbUnit framework follows some steps in its life cycle... of the life cycle are executed when executing the setUp() method before running
hibernate object states and life cycle
hibernate object states and life cycle  I am bit confused in between the hibernate states and it's life cycle. Can you please explain this also? also explain the persistent, detached and transient object states.Thanks
Life cycle of Servlet
Life cycle of Servlet       This article is discussing about the Life cycle of Servlet and teaches you the Servlet Life cycle methods. As a beginner you should understand
EJB life cycle method
EJB life cycle method      ... as the life cycle of EJB. Each type of enterprise bean has different life cycle... is the program denoting life cycle of message driven bean. package
JSF Life Cycle
JSF Life Cycle      In this we will understand the life cycle of JSF application.  Life... properties, the life cycle proceeds directly to the render response phase
Life Cycle of Threads
Life Cycle of A Thread   ... the life cycle of thread is very valuable. While a thread is alive, it is in one... start its life from Runnable state. A thread first enters runnable state after
Life Cycle of Java Server Faces
follows is called life cycle. The article ?JSF Life Cycle? explains all the life cycle phases of JSF that is very useful for the developer who want to know... cycle of JSF. Read the full article at: JSF Life Cycle
Bean life cycle in spring
Bean life cycle in spring       This example gives you an idea on how to Initialize bean in the program and also explains the lifecycle of bean in spring. Run the given bean example
System Development Life Cycle
System Development Life Cycle   ... cycle of Software Development Life Cycle. The information systems... Development life cycle. Advantages of using the SDLC also include efficient work
Product Life Cycle Diagram
Product life cycle diagram is the graphical representation of four stages... life cycle also called PLC is a concept of marketing that tells about... stages in the Product life cycle diagram indicates: Introduction
Thread Life Cycle Example in java
Thread Life Cycle Example in java In this section we will read about the life cycle example of Thread in Java. Life cycle of Thread explains you the various... when its run() method execution is completed. The life cycle of Thread is ended
EJB life cycle method
EJB life cycle method      ... as the life cycle of EJB. Each type of enterprise bean has different life cycle... is the program denoting life cycle of message driven bean. package
Stateful and Stateless Session Bean Life Cycle
Understanding Stateful and Stateless Session Bean Life Cycle... Bean Life cycle There are two stages in the Lifecycle of Stateless Session Bean... the bean into Does Not Exist state. Following Diagram shows the Life cycle
Product Life Cycle
Product life cycle is an important concept of marketing which shows the stages... of a product life cycle including introduction to growth, maturity and decline... and marketing mix accordingly. The four stages of a product life cycle
Spring Bean Life Cycle methods, Spring Bean Life Cycle
Spring Bean Life Cycle methods In this example you will know about spring bean life cycle and how a bean is initialized in the program. The bean factory container search for bean definition and also instantiates the bean
Servlet Life Cycle
The Life Cycle of Servlet having some good characterstics that allows servlet... pertains of low-level Server API progamming. The life cycle of a servlet is operated by the container in which the servlet has been deployed. Servlet life cycle
write a program in java to demonstrate the complete life cycle of servlet:
write a program in java to demonstrate the complete life cycle of servlet:  l have an assignment question. i don't know how to write the code... life cycle of a Servlet
Chapter 4. Session Bean Life Cycle
Bean Life CycleIdentify correct and incorrect statements or examples about the life cycle of a stateful or stateless session bean instance... Chapter 4. Session Bean Life CyclePrev Part I. 
 

 

 

DMCA.com