]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't assume there's always an application (#8694)
authorLeif Åstrand <leif@vaadin.com>
Mon, 7 May 2012 13:16:13 +0000 (13:16 +0000)
committerLeif Åstrand <leif@vaadin.com>
Mon, 7 May 2012 13:16:13 +0000 (13:16 +0000)
svn changeset:23684/svn branch:6.8

src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java

index 1741ec5e7fe6a0a1010aff385e707427f7f24189..2ac574c2de6e0ab946e5acd82d34e49233f0a4a8 100644 (file)
@@ -495,9 +495,11 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
 
                         }
                     } finally {
-                        requestTimer
-                                .stop((AbstractWebApplicationContext) application
-                                        .getContext());
+                        PortletSession session = request
+                                .getPortletSession(false);
+                        if (session != null) {
+                            requestTimer.stop(getApplicationContext(session));
+                        }
                     }
                 }
             }
index d42b2142fe63e373c6a8222aa114c58bc74d76b6..68089e18e031f32d842a6469f881ccf649478968 100644 (file)
@@ -552,9 +552,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
                                 .onRequestEnd(request, response);
                     }
                 } finally {
-                    requestTimer
-                            .stop((AbstractWebApplicationContext) application
-                                    .getContext());
+                    HttpSession session = request.getSession(false);
+                    if (session != null) {
+                        requestTimer.stop(getApplicationContext(session));
+                    }
                 }
             }