properties");
Properties props = new Properties();
props.load(is);
if (log.isDebugEnabled()) {
log.debug("DWikiContextListener.contextInitialized() - props = " +
props);
}
CHAPTER 5 n SHARE YOUR KNOWLEDGE: DWIKI, THE DWR-BASED WIKI 231
Config config = new Config();
config.setDatabaseDriver((String)props.get("databaseDriver"));
config.setDatabaseURI((String)props.get("databaseURI"));
config.setDatabaseUsername((String)props.get("databaseUsername"));
config.setDatabasePassword((String)props.get("databasePassword"));
config.setEditLockTime((String)props.get("editLockTime"));
if (log.isDebugEnabled()) {
log.debug("DWikiContextListener.contextInitialized() - Config = " +
config);
}
new DatabaseWorker().validateDatabase();
new Freemarker().init(inServletContextEvent.getServletContext());
} catch (Exception e) {
log.error("DWikiContextListener.contextInitialized() - " +
"Exception occurred during DWiki initialization. " +
"Application WILL NOT be available. Error was: " + e);
}
log.trace("DWikiContextListener.contextInitialized() - Exit");
} // End contextInitialized().
public void contextDestroyed (
final ServletContextEvent inServletContextEvent) {
} // End contextDestroyed().
Pages:
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425