diff options
Diffstat (limited to 'server')
4 files changed, 23 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/AbstractVaadinService.java b/server/src/com/vaadin/server/AbstractVaadinService.java index dc6342b299..6e14c1984b 100644 --- a/server/src/com/vaadin/server/AbstractVaadinService.java +++ b/server/src/com/vaadin/server/AbstractVaadinService.java @@ -76,4 +76,11 @@ public abstract class AbstractVaadinService implements VaadinService { public AddonContext getAddonContext() { return addonContext; } + + @Override + public VaadinSession getVaadinSession(WrappedRequest request) { + return (VaadinSession) request.getAttribute(VaadinSession.class + .getName()); + } + } diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index af59a09c82..4bd68bde66 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -462,6 +462,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants { return; } VaadinSession.setCurrent(application); + request.setAttribute(VaadinSession.class.getName(), application); /* * Get or create an application context and an application diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 1e9a2667c3..827902def2 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -138,4 +138,18 @@ public interface VaadinService extends Serializable { * base directory. */ public File getBaseDirectory(); + + /** + * Gets the Vaadin session associated with this request. + * + * @param request + * the request to get a vaadin session for. + * + * @see VaadinSession + * + * @return the vaadin session for the request, or <code>null</code> if no + * session is found and this is a request for which a new session + * shouldn't be created. + */ + public VaadinSession getVaadinSession(WrappedRequest request); } diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index e7e5dfe7d8..cbf5765658 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -306,6 +306,7 @@ public class VaadinServlet extends HttpServlet implements Constants { if (application == null) { return; } + request.setAttribute(VaadinSession.class.getName(), application); VaadinSession.setCurrent(application); /* |