From: Leif Åstrand Date: Fri, 19 Jul 2013 12:25:40 +0000 (+0300) Subject: Document multiple load semantics in @StyleSheet and @JavaScript (#12200) X-Git-Tag: 7.1.2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f5e3663d1fda0a5766dd1cfbb48eb31795ad93ff;p=vaadin-framework.git Document multiple load semantics in @StyleSheet and @JavaScript (#12200) Change-Id: Id52f196ad6d14e8077482b19a8d0479aedc64db3 --- diff --git a/server/src/com/vaadin/annotations/JavaScript.java b/server/src/com/vaadin/annotations/JavaScript.java index f2085556c7..bdba70c095 100644 --- a/server/src/com/vaadin/annotations/JavaScript.java +++ b/server/src/com/vaadin/annotations/JavaScript.java @@ -29,9 +29,21 @@ import com.vaadin.server.ClientConnector; * method for the corresponding client-side connector is invoked. *

* Absolute URLs including protocol and host are used as is on the client-side. - * Relative urls are mapped to APP/PUBLISHED/[url] which are by default served + * Relative URLs are mapped to APP/PUBLISHED/[url] which are by default served * from the classpath relative to the class where the annotation is defined. *

+ * The file is only loaded if it has not already been loaded, determined as + * follows: + *

+ *

* Example: {@code @JavaScript( "http://host.com/file1.js", "file2.js"})} on the * class com.example.MyConnector would load the file http://host.com/file1.js as * is and file2.js from /com/example/file2.js on the server's classpath using diff --git a/server/src/com/vaadin/annotations/StyleSheet.java b/server/src/com/vaadin/annotations/StyleSheet.java index 2e15d9481c..6540633f8f 100644 --- a/server/src/com/vaadin/annotations/StyleSheet.java +++ b/server/src/com/vaadin/annotations/StyleSheet.java @@ -29,9 +29,21 @@ import com.vaadin.server.ClientConnector; * method for the corresponding client-side connector is invoked. *

* Absolute URLs including protocol and host are used as is on the client-side. - * Relative urls are mapped to APP/PUBLISHED/[url] which are by default served + * Relative URLs are mapped to APP/PUBLISHED/[url] which are by default served * from the classpath relative to the class where the annotation is defined. *

+ * The file is only loaded if it has not already been loaded, determined as + * follows: + *

+ *

* Special Vaadin urls are also supported. The most useful is vaadin:// which * maps to the location of the automatically published VAADIN folder. Using the * VAADIN folder and vaadin:// you can publish stylesheets which use images or