summaryrefslogtreecommitdiffstats
path: root/server/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com')
-rw-r--r--server/src/com/vaadin/annotations/JavaScript.java9
-rw-r--r--server/src/com/vaadin/annotations/StyleSheet.java4
-rw-r--r--server/src/com/vaadin/data/fieldgroup/FieldGroup.java2
-rw-r--r--server/src/com/vaadin/server/VaadinPortletService.java4
-rw-r--r--server/src/com/vaadin/ui/CustomLayout.java4
-rw-r--r--server/src/com/vaadin/ui/DragAndDropWrapper.java27
6 files changed, 37 insertions, 13 deletions
diff --git a/server/src/com/vaadin/annotations/JavaScript.java b/server/src/com/vaadin/annotations/JavaScript.java
index bdba70c095..3e9c46083d 100644
--- a/server/src/com/vaadin/annotations/JavaScript.java
+++ b/server/src/com/vaadin/annotations/JavaScript.java
@@ -44,10 +44,11 @@ import com.vaadin.server.ClientConnector;
* 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
- * the ClassLoader that was used to load com.example.MyConnector.
+ * Example: <code>@JavaScript({"http://host.com/file1.js", "file2.js"})</code>
+ * 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
* @since 7.0.0
diff --git a/server/src/com/vaadin/annotations/StyleSheet.java b/server/src/com/vaadin/annotations/StyleSheet.java
index 6540633f8f..bc5b011873 100644
--- a/server/src/com/vaadin/annotations/StyleSheet.java
+++ b/server/src/com/vaadin/annotations/StyleSheet.java
@@ -49,8 +49,8 @@ import com.vaadin.server.ClientConnector;
* VAADIN folder and vaadin:// you can publish stylesheets which use images or
* other files with relative paths.
* <p>
- * Example: {@code @StyleSheet( "http://host.com/file1.css", "file2.css"})} on
- * the class com.example.MyConnector would load the file
+ * Example: <code>@StyleSheet({"http://host.com/file1.css", "file2.css"})</code>
+ * 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.
diff --git a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
index 981aea387d..23f2da53ce 100644
--- a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
+++ b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
@@ -656,7 +656,7 @@ public class FieldGroup implements Serializable {
/**
* Checks if any bound field has been modified.
*
- * @return true if at least on field has been modified, false otherwise
+ * @return true if at least one field has been modified, false otherwise
*/
public boolean isModified() {
for (Field<?> field : getFields()) {
diff --git a/server/src/com/vaadin/server/VaadinPortletService.java b/server/src/com/vaadin/server/VaadinPortletService.java
index c7fc5a23bd..194c9c88a9 100644
--- a/server/src/com/vaadin/server/VaadinPortletService.java
+++ b/server/src/com/vaadin/server/VaadinPortletService.java
@@ -201,6 +201,10 @@ public class VaadinPortletService extends VaadinService {
// been rendered, e.g. portlet on one page sends an event to a
// portlet on another page and then moves the user to that page.
return true;
+ } else if (PortletUIInitHandler.isUIInitRequest(request)) {
+ // In some cases, the RenderRequest seems to be cached, causing the
+ // first request be the one triggered by vaadinBootstrap.js.
+ return true;
}
return false;
}
diff --git a/server/src/com/vaadin/ui/CustomLayout.java b/server/src/com/vaadin/ui/CustomLayout.java
index 7bffa05058..37c9a4fa21 100644
--- a/server/src/com/vaadin/ui/CustomLayout.java
+++ b/server/src/com/vaadin/ui/CustomLayout.java
@@ -80,7 +80,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent {
* @param templateStream
* Stream containing template data. Must be using UTF-8 encoding.
* To use a String as a template use for instance new
- * ByteArrayInputStream("<template>".getBytes()).
+ * ByteArrayInputStream("&lt;template&gt;".getBytes()).
* @param streamLength
* Length of the templateStream
* @throws IOException
@@ -92,7 +92,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent {
/**
* Constructor for custom layout with given template name. Template file is
- * fetched from "<theme>/layout/<templateName>".
+ * fetched from "&lt;theme&gt;/layout/&lt;templateName&gt;".
*/
public CustomLayout(String template) {
this();
diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java
index 7a2cfb82e4..2ab3e872c6 100644
--- a/server/src/com/vaadin/ui/DragAndDropWrapper.java
+++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java
@@ -17,10 +17,12 @@ package com.vaadin.ui;
import java.io.OutputStream;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import com.vaadin.event.Transferable;
import com.vaadin.event.TransferableImpl;
@@ -183,6 +185,8 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
private final Map<String, Object> html5DataFlavors = new LinkedHashMap<String, Object>();
private DragStartMode dragStartMode = DragStartMode.NONE;
+ private Set<String> sentIds = new HashSet<String>();
+
/**
* Wraps given component in a {@link DragAndDropWrapper}.
*
@@ -229,10 +233,24 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
ProxyReceiver proxyReceiver = entry.getValue();
Html5File html5File = proxyReceiver.file;
if (html5File.getStreamVariable() != null) {
- target.addVariable(this, "rec-" + id, new ProxyReceiver(id,
- html5File));
- // these are cleaned from receivers once the upload has
- // started
+ if (!sentIds.contains(id)) {
+ target.addVariable(this, "rec-" + id,
+ new ProxyReceiver(id, html5File));
+
+ /*
+ * if a new batch is requested to be uploaded before the
+ * last one is done, any remaining ids will be replayed.
+ * We want to avoid a new ProxyReceiver to be made since
+ * it'll get a new URL, so we need to keep extra track
+ * on what has been sent.
+ *
+ * See #12330.
+ */
+ sentIds.add(id);
+
+ // these are cleaned from receivers once the upload has
+ // started
+ }
} else {
// instructs the client side not to send the file
target.addVariable(this, "rec-" + id, (String) null);
@@ -317,6 +335,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
}
// no need tell to the client about this receiver on next paint
receivers.remove(id);
+ sentIds.remove(id);
// let the terminal GC the streamvariable and not to accept other
// file uploads to this variable
event.disposeStreamVariable();