1 29 30 package com.caucho.jsp; 31 32 import com.caucho.config.ConfigException; 33 import com.caucho.config.types.PathPatternType; 34 import com.caucho.log.Log; 35 import com.caucho.server.webapp.WebApp; 36 import com.caucho.util.L10N; 37 38 import javax.servlet.ServletContextEvent ; 39 import javax.servlet.ServletContextListener ; 40 import java.util.logging.Level ; 41 import java.util.logging.Logger ; 42 43 46 public class JspPrecompileListener extends JspPrecompileResource 47 implements ServletContextListener { 48 private static final L10N L = new L10N(JspPrecompileListener.class); 49 private static final Logger log = Log.open(JspPrecompileListener.class); 50 51 54 public void addExtension(String extension) 55 throws ConfigException 56 { 57 if (extension.startsWith(".")) 58 extension = extension.substring(1); 59 60 createFileset().addInclude(new PathPatternType("**/*." + extension)); 61 } 62 63 public void contextInitialized(ServletContextEvent event) 64 { 65 try { 66 setWebApp((WebApp) event.getServletContext()); 67 68 init(); 69 70 start(); 71 } catch (Exception e) { 72 log.log(Level.WARNING, e.toString(), e); 73 } 74 } 75 76 public void contextDestroyed(ServletContextEvent event) 77 { 78 } 79 } 80 | Popular Tags |