summaryrefslogtreecommitdiff
path: root/BKUOnline
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-07-09 12:05:48 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-07-09 12:05:48 +0000
commitcf4d6b9b8315031431dd6d9460c0127286755d78 (patch)
treeae83197adc9ad0dd2bd8c6b932976de997e71ccc /BKUOnline
parentcb5ac003eb277c12ef904eb527eee5a793cae8ef (diff)
downloadmocca-cf4d6b9b8315031431dd6d9460c0127286755d78.tar.gz
mocca-cf4d6b9b8315031431dd6d9460c0127286755d78.tar.bz2
mocca-cf4d6b9b8315031431dd6d9460c0127286755d78.zip
no language
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@400 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUOnline')
-rw-r--r--BKUOnline/src/main/webapp/help.jsp25
1 files changed, 15 insertions, 10 deletions
diff --git a/BKUOnline/src/main/webapp/help.jsp b/BKUOnline/src/main/webapp/help.jsp
index 5b39547e..1d0c6f73 100644
--- a/BKUOnline/src/main/webapp/help.jsp
+++ b/BKUOnline/src/main/webapp/help.jsp
@@ -18,23 +18,28 @@
pageEncoding="UTF-8"%>
<%@ page import="java.io.File"%>
<%
- String path;
- String helpDir = "/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 = helpDir + "/index.html";
+ path.append("index.html");
} else {
- String language = pathInfo[1].split("_")[0];
- String filename = pathInfo[2];
- if ((new File(helpDir + "/" + language.toLowerCase())).isDirectory()) {
- path = helpDir + "/" + language.toLowerCase() + "/" + filename;
- } else {
- path = helpDir + "/de/" + filename;
+
+ String language = "de";
+ if (pathInfo.length > 2 && (new File("/helpfiles/" +
+ pathInfo[1].split("_")[0].toLowerCase())).isDirectory()) {
+ language = pathInfo[1].split("_")[0];
}
+ path.append(language);
+ path.append('/');
+
+ String filename = pathInfo[(pathInfo.length > 2) ? 2 : 1];
+ path.append(filename);
}
System.out.println(path);
%>
-<jsp:include page="<%=path%>" flush="true"/>
+<jsp:include page="<%=path.toString()%>" flush="true"/>