@@ -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()); | |||
} | |||
} |
@@ -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 |
@@ -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); | |||
} |
@@ -306,6 +306,7 @@ public class VaadinServlet extends HttpServlet implements Constants { | |||
if (application == null) { | |||
return; | |||
} | |||
request.setAttribute(VaadinSession.class.getName(), application); | |||
VaadinSession.setCurrent(application); | |||
/* |