diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-21 15:24:27 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-21 15:24:27 +0300 |
commit | 115e0343aa65f726f86ccc2b678ca6d5113db760 (patch) | |
tree | 6c8371c0fb97d06720b6ff3287149c6328811898 | |
parent | 31e2285c31da3507e27d0b29370f76162969c264 (diff) | |
download | vaadin-framework-115e0343aa65f726f86ccc2b678ca6d5113db760.tar.gz vaadin-framework-115e0343aa65f726f86ccc2b678ca6d5113db760.zip |
Add VaadinRequest.getContextPath() (#9706)
-rw-r--r-- | server/src/com/vaadin/server/CombinedRequest.java | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinPortletRequest.java | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinRequest.java | 12 |
3 files changed, 22 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/CombinedRequest.java b/server/src/com/vaadin/server/CombinedRequest.java index 0a7da84049..b3569a249c 100644 --- a/server/src/com/vaadin/server/CombinedRequest.java +++ b/server/src/com/vaadin/server/CombinedRequest.java @@ -186,4 +186,9 @@ public class CombinedRequest implements VaadinRequest { public VaadinService getVaadinService() { return secondRequest.getVaadinService(); } + + @Override + public String getContextPath() { + return secondRequest.getContextPath(); + } } diff --git a/server/src/com/vaadin/server/VaadinPortletRequest.java b/server/src/com/vaadin/server/VaadinPortletRequest.java index b0a16d01a4..c1bca824ef 100644 --- a/server/src/com/vaadin/server/VaadinPortletRequest.java +++ b/server/src/com/vaadin/server/VaadinPortletRequest.java @@ -225,4 +225,9 @@ public class VaadinPortletRequest implements VaadinRequest { } return (VaadinPortletRequest) request; } + + @Override + public String getContextPath() { + return request.getContextPath(); + } } diff --git a/server/src/com/vaadin/server/VaadinRequest.java b/server/src/com/vaadin/server/VaadinRequest.java index 0664d53f65..e48b9ede84 100644 --- a/server/src/com/vaadin/server/VaadinRequest.java +++ b/server/src/com/vaadin/server/VaadinRequest.java @@ -161,6 +161,18 @@ public interface VaadinRequest extends Serializable { public String getRequestPathInfo(); /** + * Returns the portion of the request URI that indicates the context of the + * request. The context path always comes first in a request URI. + * + * @see HttpServletRequest#getContextPath() + * @see PortletRequest#getContextPath() + * + * @return a String specifying the portion of the request URI that indicates + * the context of the request + */ + public String getContextPath(); + + /** * Gets the session associated with this request, creating a new if there is * no session. * |