load languages from configuration file
[pnews.git] / war / src / main / java / pnews / servlet / Pnews.java
index 94475f9..5800d04 100644 (file)
@@ -174,7 +174,7 @@ public class Pnews extends HttpServlet {
                 }
 
                 if (path.equals("/")) {
-                        doTemporaryRedirect(Language.toURL(config.getDefaultLanguage()), resp);
+                        doTemporaryRedirect(config.getDefaultLanguage().toURL(), resp);
                         return ;
                 }
 
@@ -191,8 +191,8 @@ public class Pnews extends HttpServlet {
                                 }
                         }
                         
-                        for (String l: config.getLanguages()) {
-                                if (path.equals("/" + l) || path.equals("/" + l + "/")) {
+                        for (Language l: config.getLanguages()) {
+                                if (path.equals(l.toURL())) {
                                         doTemporaryRedirect(config.getDefaultCategory().getURL(), resp);
                                         return ;
                                 }