}
if (path.equals("/")) {
- doTemporaryRedirect(Language.toURL(config.getDefaultLanguage()), resp);
+ doTemporaryRedirect(config.getDefaultLanguage().toURL(), resp);
return ;
}
}
}
- for (String l: config.getLanguages()) {
- if (path.equals("/" + l) || path.equals("/" + l + "/")) {
- doTemporaryRedirect(config.getDefaultCategory().getURL(), resp);
+ for (Language l: config.getLanguages()) {
+ if (path.equals(l.toURL())) {
+ doTemporaryRedirect(config.getDefaultCategory(l).getURL(), resp);
return ;
}
}
resp.getWriter().write("Not found " + req.getPathInfo());
resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
- } catch (IOException e) {
+ } catch (IOException | RuntimeException e) {
LOG.log(Level.SEVERE, "doGet failure", e);
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}