1 28 29 package com.caucho.jsp; 30 31 import com.caucho.log.Log; 32 import com.caucho.server.webapp.WebApp; 33 import com.caucho.vfs.Path; 34 import com.caucho.vfs.PersistentDependency; 35 36 import javax.servlet.jsp.JspFactory ; 37 import java.util.ArrayList ; 38 import java.util.logging.Logger ; 39 40 72 public class XtpManager extends PageManager { 73 private static final Logger log = Log.open(XtpManager.class); 74 75 private boolean _strictXml; 76 private boolean _toLower = true; 77 private boolean _entitiesAsText = true; 78 private XslManager _xslManager; 79 private JspManager _jspManager; 80 private String _defaultStylesheet = "default.xsl"; 81 82 XtpManager() 83 { 84 } 85 86 void initWebApp(WebApp context) 87 { 88 super.initWebApp(context); 89 90 if (JspFactory.getDefaultFactory() == null) 91 JspFactory.setDefaultFactory(new QJspFactory()); 92 93 _xslManager = new XslManager(context); 94 _jspManager = new JspManager(); 95 _jspManager.initWebApp(context); 96 } 97 98 101 public String getDefaultStylesheet() 102 { 103 return _defaultStylesheet; 104 } 105 106 109 public void setDefaultStylesheet(String stylesheet) 110 { 111 _defaultStylesheet = stylesheet; 112 } 113 114 118 public void setStrictXml(boolean strictXml) 119 { 120 _strictXml = strictXml; 121 } 122 123 127 public void setStrictXsl(boolean strictXsl) 128 { 129 _xslManager.setStrictXsl(strictXsl); 130 } 131 132 135 public void setToLower(boolean toLower) 136 { 137 _toLower = toLower; 138 } 139 140 143 public void setEntitiesAsText(boolean entitiesAsText) 144 { 145 _entitiesAsText = entitiesAsText; 146 } 147 148 162 Page createPage(Path path, String uri, String className, 163 ArrayList <PersistentDependency> dependList) 164 throws Exception 165 { 166 if (path == null || ! path.canRead() || path.isDirectory()) 167 return null; 168 169 XtpPage xtpPage = new XtpPage(path, uri, 170 className, 171 _webApp, _xslManager, _strictXml); 172 xtpPage.setManager(_jspManager); 173 xtpPage.setHtmlToLower(_toLower); 174 175 return xtpPage; 176 } 177 } 178 | Popular Tags |