diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-20 13:42:26 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-20 13:52:36 +0300 |
commit | d66d9b3f5d3a85fb8016eb75ae68267d50244cd9 (patch) | |
tree | 42a18791aab066a6710b85885f3097a63eb157cc /server/src/com/vaadin | |
parent | c48b696af7fe90c005715a6f1b580375952d5633 (diff) | |
download | vaadin-framework-d66d9b3f5d3a85fb8016eb75ae68267d50244cd9.tar.gz vaadin-framework-d66d9b3f5d3a85fb8016eb75ae68267d50244cd9.zip |
Create the right VaadinSession type
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/server/VaadinPortlet.java | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinService.java | 20 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinServlet.java | 6 |
3 files changed, 19 insertions, 12 deletions
diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index 678308485b..e9bd3a08cf 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -241,6 +241,11 @@ public class VaadinPortlet extends GenericPortlet implements Constants { return (WrappedPortletResponse) VaadinService.getCurrentResponse(); } + @Override + protected VaadinSession createVaadinSession(WrappedRequest request) + throws ServiceException { + return new VaadinPortletSession(); + } } public static class WrappedHttpAndPortletRequest extends diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 80590df4a0..afdfdad121 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -318,6 +318,12 @@ public abstract class VaadinService implements Serializable { throws ServiceException { VaadinSession session = createVaadinSession(request); + try { + ServletPortletHelper.initDefaultUIProvider(session, this); + } catch (ApplicationClassException e) { + throw new ServiceException(e); + } + session.storeInSession(request.getWrappedSession()); URL applicationUrl; @@ -376,18 +382,8 @@ public abstract class VaadinService implements Serializable { * @throws ServletException * @throws MalformedURLException */ - private VaadinServletSession createVaadinSession(WrappedRequest request) - throws ServiceException { - VaadinServletSession session = new VaadinServletSession(); - - try { - ServletPortletHelper.initDefaultUIProvider(session, this); - } catch (ApplicationClassException e) { - throw new ServiceException(e); - } - - return session; - } + protected abstract VaadinSession createVaadinSession(WrappedRequest request) + throws ServiceException; private void onVaadinSessionStarted(WrappedRequest request, VaadinSession session) throws ServiceException { diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 19e831c51b..376750980b 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -217,6 +217,12 @@ public class VaadinServlet extends HttpServlet implements Constants { return (WrappedHttpServletResponse) VaadinService .getCurrentResponse(); } + + @Override + protected VaadinSession createVaadinSession(WrappedRequest request) + throws ServiceException { + return new VaadinServletSession(); + } } private static class AbstractApplicationServletWrapper implements Callback { |