]> source.dussan.org Git - vaadin-framework.git/commitdiff
made static file path configurable, default is to serve them via applicationServlet
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 23 Nov 2007 10:36:13 +0000 (10:36 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 23 Nov 2007 10:36:13 +0000 (10:36 +0000)
svn changeset:2907/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java

index e59907a70fec2587365d0136f3f8e7cb1a9d87b6..9b7595d18ef75139226b561facbee7cdb59f3596 100644 (file)
@@ -111,6 +111,8 @@ public class ApplicationServlet extends HttpServlet {
     // Configurable parameter names
     private static final String PARAMETER_DEBUG = "Debug";
 
+    private static final String PARAMETER_ITMILL_RESOURCES = "Resources";
+
     private static final int DEFAULT_BUFFER_SIZE = 32 * 1024;
 
     private static final int MAX_BUFFER_SIZE = 64 * 1024;
@@ -515,17 +517,18 @@ public class ApplicationServlet extends HttpServlet {
             widgetset = DEFAULT_WIDGETSET;
         }
 
-        String contextPath = request.getContextPath();
+        String staticFilePath = getApplicationOrSystemProperty(
+                PARAMETER_ITMILL_RESOURCES, appUrl);
 
         // Default theme does not use theme URI
         String themeUri = null;
         if (themeName != null) {
             // Using custom theme
-            themeUri = contextPath + "/" + THEME_DIRECTORY_PATH + themeName;
+            themeUri = staticFilePath + "/" + THEME_DIRECTORY_PATH + themeName;
         }
         page.write("', pathInfo: '" + pathInfo + "', themeUri: '" + themeUri
                 + "'\n};\n" + "</script>\n"
-                + "<script language='javascript' src='" + contextPath + "/"
+                + "<script language='javascript' src='" + staticFilePath + "/"
                 + WIDGETSET_DIRECTORY_PATH + widgetset + "/" + widgetset
                 + ".nocache.js'></script>\n");