diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/annotations/JavaScript.java | 10 | ||||
-rw-r--r-- | src/com/vaadin/annotations/StyleSheet.java | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/com/vaadin/annotations/JavaScript.java b/src/com/vaadin/annotations/JavaScript.java index 065c37b78d..f97457c1cd 100644 --- a/src/com/vaadin/annotations/JavaScript.java +++ b/src/com/vaadin/annotations/JavaScript.java @@ -15,6 +15,16 @@ import com.vaadin.terminal.gwt.server.ClientConnector; * If this annotation is present on a {@link ClientConnector} class, the * framework ensures the referenced JavaScript files are loaded before the init * 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/CONNECTOR/[url] which are by default served + * from the classpath relative to the class where the annotation is defined. + * <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 the ClassLoader that was used to load + * com.example.MyConnector. * * @author Vaadin Ltd * @version @VERSION@ diff --git a/src/com/vaadin/annotations/StyleSheet.java b/src/com/vaadin/annotations/StyleSheet.java index f8bf635474..d082cb8d30 100644 --- a/src/com/vaadin/annotations/StyleSheet.java +++ b/src/com/vaadin/annotations/StyleSheet.java @@ -15,6 +15,12 @@ import com.vaadin.terminal.gwt.server.ClientConnector; * If this annotation is present on a {@link ClientConnector} class, the * framework ensures the referenced style sheets are loaded before the init * method for the corresponding client-side connector is invoked. + * <p> + * Example: {@code @StyleSheet( "http://host.com/file1.css", "file2.css"})} on + * the class com.example.MyConnector would load the file + * http://host.com/file1.css as is and file2.css from /com/example/file2.css on + * the server's classpath using the ClassLoader that was used to load + * com.example.MyConnector. * * @author Vaadin Ltd * @version @VERSION@ |