From 060ba3b63cf1c46bb726a6f6f0910924fb185364 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 28 Jun 2012 18:47:01 +0300 Subject: [PATCH] Describe how paths are resolved in javadoc (#9048) --- src/com/vaadin/annotations/JavaScript.java | 10 ++++++++++ src/com/vaadin/annotations/StyleSheet.java | 6 ++++++ 2 files changed, 16 insertions(+) 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. + *

+ * 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. + *

+ * 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. + *

+ * 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@ -- 2.39.5