summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-12-15 21:12:35 +0200
committerSauli Tähkäpää <sauli@vaadin.com>2014-12-17 11:06:10 +0200
commit3e1ab9ec5de08f21031a41363924c2e692a46f8f (patch)
treeac67ccf5bc00b89b62986169181a48fa1d89dbfa /server
parentb3281afe944f1dcafea361a93d67d1a68850a33b (diff)
downloadvaadin-framework-3e1ab9ec5de08f21031a41363924c2e692a46f8f.tar.gz
vaadin-framework-3e1ab9ec5de08f21031a41363924c2e692a46f8f.zip
Handle portlet error messages properly (#15398)
Change-Id: Ie7936fd2eaca0e0c5da1f6ed8f12238ae207b7eb
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/VaadinPortletResponse.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/VaadinPortletResponse.java b/server/src/com/vaadin/server/VaadinPortletResponse.java
index 7a0a68d116..d9f133ac8a 100644
--- a/server/src/com/vaadin/server/VaadinPortletResponse.java
+++ b/server/src/com/vaadin/server/VaadinPortletResponse.java
@@ -30,6 +30,8 @@ import javax.portlet.PortletResponse;
import javax.portlet.ResourceResponse;
import javax.servlet.http.Cookie;
+import com.google.gwt.thirdparty.guava.common.html.HtmlEscapers;
+
/**
* Wrapper for {@link PortletResponse} and its subclasses.
*
@@ -128,6 +130,9 @@ public class VaadinPortletResponse implements VaadinResponse {
@Override
public void sendError(int errorCode, String message) throws IOException {
setStatus(errorCode);
+ if (message != null) {
+ message = HtmlEscapers.htmlEscaper().escape(message);
+ }
getWriter().write(message);
}