1 29 30 package com.caucho.jsp; 31 32 import com.caucho.server.webapp.WebApp; 33 34 import javax.servlet.ServletConfig ; 35 import javax.servlet.ServletException ; 36 import javax.servlet.jsp.JspFactory ; 37 38 43 public class JspServlet extends QServlet { 44 static final String COPYRIGHT = 45 "Copyright (c) 1998-2006 Caucho Technology. All rights reserved."; 46 47 private boolean _isXml = false; 48 private boolean _loadTldOnInit = false; 49 private int _pageCacheMax = 256; 50 51 54 public void setXml(boolean isXml) 55 { 56 _isXml = isXml; 57 } 58 59 62 public void setLoadTldOnInit(boolean isPreload) 63 { 64 _loadTldOnInit = isPreload; 65 } 66 67 70 public void setPageCacheMax(int max) 71 { 72 _pageCacheMax = max; 73 } 74 75 79 public void init(ServletConfig conf) 80 throws ServletException 81 { 82 super.init(conf); 83 84 JspManager manager = new JspManager(); 85 86 manager.setXml(_isXml); 87 manager.setLoadTldOnInit(_loadTldOnInit); 88 manager.setPageCacheMax(_pageCacheMax); 89 90 manager.initWebApp((WebApp) getServletContext()); 91 92 setManager(manager); 93 94 manager.init(); 95 96 if (JspFactory.getDefaultFactory() == null) 97 JspFactory.setDefaultFactory(new QJspFactory()); 98 } 99 100 103 public static void initStatic() 104 { 105 if (JspFactory.getDefaultFactory() == null) 106 JspFactory.setDefaultFactory(new QJspFactory()); 107 } 108 109 public String getServletInfo() 110 { 111 return "JSP"; 112 } 113 } 114 115 | Popular Tags |