]> source.dussan.org Git - vaadin-framework.git/commitdiff
Use classloader also to find theme styles.scss (#10107) 74/274/2
authorArtur Signell <artur@vaadin.com>
Thu, 15 Nov 2012 11:51:14 +0000 (13:51 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 20 Nov 2012 11:40:19 +0000 (11:40 +0000)
Change-Id: I4fb5790dc23e8c5cedfc2113158181abf646245e

server/src/com/vaadin/server/VaadinServlet.java

index 2ef95508231ffdcedc82fa4fafb709bd55237e04..23378e4c2005125b7b38e6e9d37a7665ac33d1ce 100644 (file)
@@ -936,6 +936,17 @@ public class VaadinServlet extends HttpServlet implements Constants {
         }
         String realFilename = sc.getRealPath(scssFilename);
         ScssStylesheet scss = ScssStylesheet.get(realFilename);
+        if (scss == null) {
+            // Not a file in the file system (WebContent directory). Use the
+            // identifier directly (VAADIN/themes/.../styles.css) so
+            // ScssStylesheet will try using the class loader.
+            if (scssFilename.startsWith("/")) {
+                scssFilename = scssFilename.substring(1);
+            }
+
+            scss = ScssStylesheet.get(scssFilename);
+        }
+
         if (scss == null) {
             getLogger()
                     .warning(