life cycle of JSP

LIFE CYCLE OF JSP

0  0 2016-10-03 02:32:21

Java Server Page (JSP) is a technology is used for controlling the content or appearance of the Web pages through the use of servlet,every small programs that are specified in Web page and run on Web server are to modify the Web page before it is sent been to the user who have requested for it. Sun Microsystems, the developer of Java, also it refers to the JSP(Java Server Pages) technology as the Servlet application program interface (API). JSP is comparable to the Microsoft's Active Server Page (ASP) technology. Whereas  Java Server Page calls  Java program that is been executed by Web server, an Active Server Page contains script that is been interpreted by the script interpreter (as VBScript or JScript) before the page is sent to the user.

A JSP page services requests as a servlet. Thus the life cycle and many of the capabilities of JSP pages are determined by java servlet technology. When a request is mapped to a JSP page, it is handled by special servlet that first checks whether the JSP page’s servlet is older than JSP page.
If it is , it translates the JSP page into a servlet class and complies the   class. During development, one of the advantages of JSP pages over servlets is that the build process if performed automatically.
During the translation phase , each type of data in a JSP page is treated differently. Template data is transformed into code that will emit the data into the stream that returns data to the client.JSP elements are treated as Follows:
1.Directives are used to control how the web container translates and executes the JSP page.
2. Scripting elements are inserted into the JSP pages servlet class.
3. Action elements of the form are converted into into method calls to javabeans components or invocations of the java Serrvlet API.

Error 1: Both the translation and compilation phases can yield errors that only observed when the page is requested for the first time. If an error occours while the page is being translated, the server will return ParseException, and the servlet class source file will be empty or incomplete.

Error 2: If an error occurs while the JSP page is being compiled the server will return a JasperException, and a message that includes the name of JSP page’s servlet and the line where the error occours.

 

Comments (0)

Post Your Comments

Headquarter



Hong Kong Office



Find Us On

Website Development Company
SEO
Digital Marketing
website development company in Hong Kong
website designer in pune