public ReaderHandler(LowLevelDbAccess lowLevelDbAccess, String webDir) { loginInfoDb = new LoginInfo.DB(lowLevelDbAccess); userDb = new User.DB(lowLevelDbAccess); feedDb = new Feed.DB(lowLevelDbAccess); articleDb = new Article.DB(lowLevelDbAccess); readArticlesCollDb = new ReadArticlesColl.DB(lowLevelDbAccess); userHelpers = new UserHelpers(loginInfoDb, userDb); setContextPath("/"); File warPath = new File(webDir); setWar(warPath.getAbsolutePath()); if (isInJar) { for (Map.Entry<String, String> entry : PATH_MAPPING.entrySet()) { addPrebuiltJsp(entry.getKey(), "jsp." + entry.getValue().replaceAll("_", "_005f") + "_jsp"); } } else { for (Map.Entry<String, String> entry : PATH_MAPPING.entrySet()) { addServlet( new ServletHolder(new RedirectServlet("/" + entry.getValue() + ".jsp")), entry.getKey()); } } setErrorHandler(new ReaderErrorHandler()); }
static { PATH_MAPPING.put("", "home_page"); PATH_MAPPING.put(PATH_LOGIN, "login"); PATH_MAPPING.put(PATH_LOGOUT, "login"); // !!! after logout we get redirected to /login PATH_MAPPING.put(PATH_SIGNUP, "signup"); PATH_MAPPING.put(PATH_ERROR, "error"); PATH_MAPPING.put(PATH_FEED_ADMIN, "feed_admin"); PATH_MAPPING.put(PATH_SETTINGS, "settings"); PATH_MAPPING.put(PATH_FEEDS, "feeds"); PATH_MAPPING.put(PATH_FEED + "/*", "feed"); PATH_MAPPING.put(PATH_ADMIN, "admin"); }