JSP & Servlet Life Cycle


Table of Contents

Additional Resources
JSP to Servlet Source Code Generation (Translation)
Servlet Life Cycle
Overview
Constructor
Init
Service
Destroy
Session Management
HTTPSession Creation
Review
Thank You
How was this presentation made?
				
<html>
  <head><title>Hello World</title><head>
  <body>
    <h1>Hello World!!!</h1>
    <br/>
    Today is <%=new java.util.Date()%>
  </body>
</html>

			

*** public abstract class HttpJspBase extends javax.servlet.http.HttpServlet implements javax.servlet.jsp.HttpJspPage

HelloWorld_jsp.java
01 package org.apache.jsp;
02 
03 import javax.servlet.*;
04 import javax.servlet.http.*;
05 import javax.servlet.jsp.*;
06 
07 public final class HelloWorld_jsp extends org.apache.jasper.runtime.HttpJspBase
08     implements org.apache.jasper.runtime.JspSourceDependent {
09 
10   private static java.util.Vector _jspx_dependants;
11 
12   public java.util.List getDependants() {
13     return _jspx_dependants;
14   }
15 
16   public void _jspService(HttpServletRequest request, HttpServletResponse response)
17         throws java.io.IOException, ServletException {
18 
19     JspFactory _jspxFactory = null;
20     PageContext pageContext = null;
21     HttpSession session = null;
22     ServletContext application = null;
23     ServletConfig config = null;
24     JspWriter out = null;
25     Object page = this;
26     JspWriter _jspx_out = null;
27     PageContext _jspx_page_context = null;
28 
29 
30     try {
31       _jspxFactory = JspFactory.getDefaultFactory();
32       response.setContentType("text/html");
33       pageContext = _jspxFactory.getPageContext(this, request, response,
34             null, true, 8192true);
35       _jspx_page_context = pageContext;
36       application = pageContext.getServletContext();
37       config = pageContext.getServletConfig();
38       session = pageContext.getSession();
39       out = pageContext.getOut();
40       _jspx_out = out;
41 
42       out.write("<html>\r\n");
43       out.write("  <head><title>Hello World</title><head>\r\n");
44       out.write("  <body>\r\n");
45       out.write("    <h1>Hello World!!!</h1>\r\n");
46       out.write("    <br/>\r\n");
47       out.write("    Today is ");
48       out.print(new java.util.Date());
49       out.write("\r\n");
50       out.write("  </body>\r\n");
51       out.write("</html>");
52     catch (Throwable t) {
53       if (!(instanceof SkipPageException)){
54         out = _jspx_out;
55         if (out != null && out.getBufferSize() != 0)
56           out.clearBuffer();
57         if (_jspx_page_context != null_jspx_page_context.handlePageException(t);
58       }
59     finally {
60       if (_jspxFactory != null_jspxFactory.releasePageContext(_jspx_page_context);
61     }
62   }
63 }

Any Questions?

Feel Free to contact me anytime at http://www.javaclimber.com

DocBook

According to the official DocBook web site,

??

DocBook is a general purpose XML and SGML document type particularly well suited to books and papers about computer hardware and software (though it is by no means limited to these applications).

??
??--DocBook.org