Mercurial > hg > digilib-old
comparison servlet3/src/main/java/digilib/servlet/Initialiser.java @ 1158:2ee261676828 default tip
better out-of-the box experience:
* digilib works without config files using sensible defaults
* new sample images folder used by default
* config files moved to templates
author | robcast |
---|---|
date | Tue, 19 Feb 2013 17:32:25 +0100 |
parents | b2d97b842612 |
children |
comparison
equal
deleted
inserted
replaced
1157:7a4f27ee087f | 1158:2ee261676828 |
---|---|
52 @WebListener | 52 @WebListener |
53 public class Initialiser implements ServletContextListener, ServletRequestListener { | 53 public class Initialiser implements ServletContextListener, ServletRequestListener { |
54 | 54 |
55 | 55 |
56 /** servlet version */ | 56 /** servlet version */ |
57 public static final String version = "0.3"; | 57 public static final String version = "0.4"; |
58 | 58 |
59 /** gengeral logger for this class */ | 59 /** gengeral logger for this class */ |
60 private static Logger logger = Logger.getLogger("digilib.init"); | 60 private static Logger logger = Logger.getLogger("digilib.init"); |
61 | 61 |
62 /** DocuDirCache instance */ | 62 /** DocuDirCache instance */ |
95 */ | 95 */ |
96 | 96 |
97 // set up the logger | 97 // set up the logger |
98 File logConf = ServletOps.getConfigFile((File) dlConfig | 98 File logConf = ServletOps.getConfigFile((File) dlConfig |
99 .getValue("log-config-file"), context); | 99 .getValue("log-config-file"), context); |
100 DOMConfigurator.configure(logConf.getAbsolutePath()); | 100 if (logConf.canRead()) { |
101 dlConfig.setValue("log-config-file", logConf); | 101 DOMConfigurator.configure(logConf.getAbsolutePath()); |
102 dlConfig.setValue("log-config-file", logConf); | |
103 } | |
102 // say hello in the log file | 104 // say hello in the log file |
103 logger | 105 logger |
104 .info("***** Digital Image Library Initialiser (version " | 106 .info("***** Digital Image Library Initialiser (version " |
105 + version + ") *****"); | 107 + version + ") *****"); |
106 // directory cache | 108 // directory cache |