summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/vaadin/terminal/PaintTarget.java5
-rwxr-xr-xsrc/com/vaadin/terminal/gwt/client/ApplicationConnection.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java6
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VUpload.java4
-rw-r--r--src/com/vaadin/terminal/gwt/server/CommunicationManager.java5
-rw-r--r--src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java11
6 files changed, 17 insertions, 17 deletions
diff --git a/src/com/vaadin/terminal/PaintTarget.java b/src/com/vaadin/terminal/PaintTarget.java
index a81c637de2..d118562588 100644
--- a/src/com/vaadin/terminal/PaintTarget.java
+++ b/src/com/vaadin/terminal/PaintTarget.java
@@ -8,6 +8,7 @@ import java.io.Serializable;
import java.util.Map;
import com.vaadin.terminal.StreamVariable.StreamingStartEvent;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
/**
* This interface defines the methods for painting XML to the UIDL stream.
@@ -158,6 +159,10 @@ public interface PaintTarget extends Serializable {
* terminals Receivers are typically rendered for the client side as URLs,
* where the client side implementation can do an http post request.
* <p>
+ * The urls in UIDL message may use Vaadin specific protocol. Before
+ * actually using the urls on the client side, they should be passed via
+ * {@link ApplicationConnection#translateVaadinUri(String)}.
+ * <p>
* Note that in current terminal implementation StreamVariables are cleaned
* from the terminal only when:
* <ul>
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index df8fd11ca3..1c80002085 100755
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -2147,6 +2147,9 @@ public class ApplicationConnection {
}
uidlUri = themeUri + uidlUri.substring(7);
}
+ if (uidlUri.startsWith("app://")) {
+ uidlUri = getAppUri() + uidlUri.substring(6);
+ }
return uidlUri;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
index a8750a8340..704a43c403 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
@@ -198,15 +198,15 @@ public class VDragAndDropWrapper extends VCustomComponent implements
uploading = true;
final Integer fileId = fileIds.remove(0);
VHtml5File file = files.remove(0);
- final String receiverUrl = fileIdToReceiver
- .remove(fileId.toString());
+ final String receiverUrl = client
+ .translateVaadinUri(fileIdToReceiver
+ .remove(fileId.toString()));
ExtendedXHR extendedXHR = (ExtendedXHR) ExtendedXHR
.create();
extendedXHR
.setOnReadyStateChange(readyStateChangeHandler);
extendedXHR.open("POST", receiverUrl);
extendedXHR.postFile(file);
-
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java
index ddca44d7d4..3c81736d87 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java
@@ -151,7 +151,9 @@ public class VUpload extends SimplePanel implements Paintable {
this.client = client;
paintableId = uidl.getId();
nextUploadId = uidl.getIntAttribute("nextid");
- element.setAction(uidl.getStringVariable("action"));
+ final String action = client.translateVaadinUri(uidl
+ .getStringVariable("action"));
+ element.setAction(action);
if(uidl.hasAttribute("buttoncaption")) {
submitButton.setText(uidl.getStringAttribute("buttoncaption"));
submitButton.setVisible(true);
diff --git a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
index 111f43b31f..5851621a20 100644
--- a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
@@ -396,9 +396,8 @@ public class CommunicationManager extends AbstractCommunicationManager {
streamVariableToSeckey.put(value, seckey);
}
- return getApplication().getURL()
- + AbstractApplicationServlet.UPLOAD_URL_PREFIX + key + "/"
- + seckey;
+ return "app://" + AbstractApplicationServlet.UPLOAD_URL_PREFIX + key
+ + "/" + seckey;
}
diff --git a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
index 8c8ab1e1be..080ff33af5 100644
--- a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
+++ b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
@@ -371,16 +371,7 @@ public class JsonPaintTarget implements PaintTarget {
"Application not specified for resorce "
+ value.getClass().getName());
}
- String uri;
- if (a.getURL() != null) {
- uri = a.getURL().getPath();
- } else {
- uri = "";
- }
- if (uri.length() > 0 && uri.charAt(uri.length() - 1) != '/') {
- uri += "/";
- }
- uri += a.getRelativeLocation(r);
+ final String uri = "app://" + a.getRelativeLocation(r);
addAttribute(name, uri);
} else if (value instanceof ThemeResource) {