1 28 29 package com.caucho.jsp; 30 31 import com.caucho.server.webapp.WebApp; 32 33 import javax.servlet.ServletConfig ; 34 import javax.servlet.ServletException ; 35 import javax.servlet.jsp.JspFactory ; 36 37 42 public class XtpServlet extends QServlet { 43 static final String COPYRIGHT = 44 "Copyright (c) 1998-2006 Caucho Technology. All rights reserved."; 45 46 60 public void init(ServletConfig conf) 61 throws ServletException 62 { 63 super.init(conf); 64 65 XtpManager manager = new XtpManager(); 66 manager.initWebApp((WebApp) getServletContext()); 67 68 setManager(manager); 69 70 String strictXslValue = conf.getInitParameter("strict-xsl"); 71 if (strictXslValue != null && 72 ! strictXslValue.equals("false") && 73 ! strictXslValue.equals("no")) 74 manager.setStrictXsl(true); 75 76 String strictXmlValue = conf.getInitParameter("strict-xml"); 77 if (strictXmlValue != null && 78 ! strictXmlValue.equals("false") && 79 ! strictXmlValue.equals("no")) 80 manager.setStrictXml(true); 81 82 String entitiesAsText = conf.getInitParameter("entities-as-text"); 83 if (entitiesAsText != null && 84 ! entitiesAsText.equals("false") && 85 ! entitiesAsText.equals("no")) 86 manager.setEntitiesAsText(true); 87 88 String toLower = conf.getInitParameter("html-to-lower"); 89 if (toLower != null && 90 (toLower.equals("no") || toLower.equals("false"))) 91 manager.setToLower(false); 92 93 String defaultStylesheet = getInitParameter("default-stylesheet"); 94 if (defaultStylesheet != null && ! defaultStylesheet.equals("")) 95 manager.setDefaultStylesheet(defaultStylesheet); 96 97 if (JspFactory.getDefaultFactory() == null) 98 JspFactory.setDefaultFactory(QJspFactory.create()); 99 } 100 101 public String getServletInfo() 102 { 103 return "XTP"; 104 } 105 } 106 | Popular Tags |