diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-07-19 15:25:40 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-07-30 12:59:23 +0000 |
commit | f5e3663d1fda0a5766dd1cfbb48eb31795ad93ff (patch) | |
tree | 6e37a6782b1e48d2433965ca68278ab230520389 /server/src/com/vaadin/annotations/JavaScript.java | |
parent | 5d571299656176bf27699010851ded45894945e0 (diff) | |
download | vaadin-framework-f5e3663d1fda0a5766dd1cfbb48eb31795ad93ff.tar.gz vaadin-framework-f5e3663d1fda0a5766dd1cfbb48eb31795ad93ff.zip |
Document multiple load semantics in @StyleSheet and @JavaScript (#12200)
Change-Id: Id52f196ad6d14e8077482b19a8d0479aedc64db3
Diffstat (limited to 'server/src/com/vaadin/annotations/JavaScript.java')
-rw-r--r-- | server/src/com/vaadin/annotations/JavaScript.java | 14 |
1 files changed, 13 insertions, 1 deletions
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. * <p> * 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. * <p> + * The file is only loaded if it has not already been loaded, determined as + * follows: + * <ul> + * <li>For absolute URLs, the URL is considered loaded if the same URL has + * previously been loaded using {@code @JavaScript} or if a script tag loaded + * from the same URL was present in the DOM when the Vaadin client-side was + * initialized. + * <li>For relative URLs, the URL is considered loaded if another file with the + * same name has already been loaded using {@code @JavaScript}, even if that + * file was loaded from a different folder. + * </ul> + * <p> * 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 |