[Mulgara-svn] r1707 - trunk/src/jar/web/java/org/mulgara/webquery

pag at mulgara.org pag at mulgara.org
Sat May 30 02:24:26 UTC 2009


Author: pag
Date: 2009-05-29 19:24:25 -0700 (Fri, 29 May 2009)
New Revision: 1707

Modified:
   trunk/src/jar/web/java/org/mulgara/webquery/QueryServlet.java
Log:
Taking into account the tutorial servlet as well as the webui

Modified: trunk/src/jar/web/java/org/mulgara/webquery/QueryServlet.java
===================================================================
--- trunk/src/jar/web/java/org/mulgara/webquery/QueryServlet.java	2009-05-30 02:23:45 UTC (rev 1706)
+++ trunk/src/jar/web/java/org/mulgara/webquery/QueryServlet.java	2009-05-30 02:24:25 UTC (rev 1707)
@@ -84,6 +84,9 @@
   /** This path is needed to help with variations in different servlet environments. */
   public static final String SERVLET_PATH = "/webui";
 
+  /** This tutorial path is needed to help with variations in different servlet environments. */
+  public static final String TUTORIAL_PATH = "/tutorial";
+
   /** Session value for the TQL interpreter. */
   private static final String TQL_INTERPRETER = "session.tql.interpreter";
 
@@ -740,8 +743,13 @@
 
 
   private String calcBasePath(String fullpath) {
-    if (!fullpath.contains(SERVLET_PATH)) return "/";
-    return fullpath.substring(0, fullpath.indexOf(SERVLET_PATH) + SERVLET_PATH.length()) + "/";
+    if (fullpath.contains(SERVLET_PATH)) {
+      return fullpath.substring(0, fullpath.indexOf(SERVLET_PATH) + SERVLET_PATH.length()) + "/";
+    }
+    if (fullpath.contains(TUTORIAL_PATH)) {
+      return fullpath.substring(0, fullpath.indexOf(TUTORIAL_PATH) + TUTORIAL_PATH.length()) + "/";
+    }
+    return "/";
   }
 
 




More information about the Mulgara-svn mailing list