diff options
author | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-07-09 14:07:51 +0000 |
---|---|---|
committer | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-07-09 14:07:51 +0000 |
commit | 44e7ad81fdc87e81017d02e803e907008757a822 (patch) | |
tree | 4b3b60db90468ea4178833ee291d6aea65bf5b17 | |
parent | cb4496d82e8271102cda305e5490d6bc55e63fb6 (diff) | |
download | mocca-44e7ad81fdc87e81017d02e803e907008757a822.tar.gz mocca-44e7ad81fdc87e81017d02e803e907008757a822.tar.bz2 mocca-44e7ad81fdc87e81017d02e803e907008757a822.zip |
temp
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@404 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r-- | BKUOnline/src/main/webapp/help.jsp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/BKUOnline/src/main/webapp/help.jsp b/BKUOnline/src/main/webapp/help.jsp index 1d0c6f73..066ec59e 100644 --- a/BKUOnline/src/main/webapp/help.jsp +++ b/BKUOnline/src/main/webapp/help.jsp @@ -17,26 +17,31 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="java.io.File"%> +<%@ page import="java.util.Locale"%> <% - StringBuilder path = new StringBuilder("/helpfiles/"); + StringBuilder path = new StringBuilder("/helpfiles"); //servlet mapping assures pathInfo[0] == help //expect pathinfo /help/<languagecode>/<helpfile> String pathInfo[] = (request.getPathInfo() != null) ? request .getPathInfo().split("/") : new String[] {}; if (pathInfo.length < 2) { - path.append("index.html"); + path.append("/index.html"); } else { - String language = "de"; - if (pathInfo.length > 2 && (new File("/helpfiles/" + - pathInfo[1].split("_")[0].toLowerCase())).isDirectory()) { - language = pathInfo[1].split("_")[0]; + //System.out.println("locale " + pathInfo[1] + ": " + pathInfo[1].substring(0, 2).toLowerCase()); //new Locale(pathInfo[1]).getLanguage()); + //System.out.println("is dir: " + new File("/helpfiles/de").isDirectory()); + //+ pathInfo[1].substring(0, 2).toLowerCase()).isDirectory()); + if (pathInfo.length > 2 && new File("/helpfiles/" // + new Locale(pathInfo[1]).getLanguage()).isDirectory())) { + + pathInfo[1].substring(0, 2).toLowerCase()).isDirectory()) { + System.out.println("locale " + new Locale(pathInfo[1])); + language = new Locale(pathInfo[1]).getLanguage(); } - path.append(language); path.append('/'); + path.append(language); String filename = pathInfo[(pathInfo.length > 2) ? 2 : 1]; + path.append('/'); path.append(filename); } System.out.println(path); |