1 29 30 package com.caucho.jsp; 31 32 import com.caucho.vfs.PersistentDependency; 33 34 import javax.servlet.ServletConfig ; 35 import javax.servlet.ServletException ; 36 import javax.servlet.ServletRequest ; 37 import javax.servlet.ServletResponse ; 38 import javax.servlet.http.HttpServletRequest ; 39 import javax.servlet.http.HttpServletResponse ; 40 import javax.servlet.jsp.HttpJspPage ; 41 import java.io.IOException ; 42 import java.util.ArrayList ; 43 44 public abstract class JavaPage extends Page implements HttpJspPage 45 { 46 public void init(ServletConfig config) 47 throws ServletException 48 { 49 super.init(config); 50 51 jspInit(); 52 } 53 54 public void jspInit() 55 { 56 } 57 58 public void service(ServletRequest request, ServletResponse response) 59 throws ServletException , IOException 60 { 61 _jspService((HttpServletRequest ) request, 62 (HttpServletResponse ) response); 63 } 64 65 abstract public void _jspService(HttpServletRequest request, 66 HttpServletResponse response) 67 throws ServletException , IOException ; 68 69 public String getServletInfo() 70 { 71 return "A Java JSP page"; 72 } 73 74 77 public static void addDepend(ArrayList list, PersistentDependency depend) 78 { 79 ArrayList <PersistentDependency> pList; 80 pList = (ArrayList <PersistentDependency>) list; 81 82 pList.add(depend); 83 } 84 85 public void destroy() 86 { 87 if (isDead()) { 88 return; 89 } 90 91 try { 92 jspDestroy(); 93 } catch (Throwable e) { 94 } 95 96 super.destroy(); 97 } 98 99 public void jspDestroy() 100 { 101 } 102 } 103 | Popular Tags |