package hirondelle.web4j.config;
import hirondelle.predict.main.codes.CodeTableUtil;
import hirondelle.predict.util.Captcha;
import hirondelle.web4j.StartupTasks;
import hirondelle.web4j.database.DAOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
public final class Startup implements StartupTasks {
public void startApplication(ServletConfig aConfig, String aDbName) throws DAOException {
if (ConnectionSrc.DEFAULT.equals(aDbName)){
fContext = aConfig.getServletContext();
lookUpCodeTablesAndPlaceIntoAppScope();
Captcha.init(aConfig.getInitParameter("CaptchaPrivateKey"));
}
}
public static void lookUpCodeTablesAndPlaceIntoAppScope() throws DAOException {
CodeTableUtil.init(fContext);
}
private static ServletContext fContext;
}